Meanwhile, in the DWScript SVN…
This summary of recent DWS changes is coming a bit late, and there is quite a bit to cover. Here is a quick, partial roundup of what changed since the last update. (more…)
This summary of recent DWS changes is coming a bit late, and there is quite a bit to cover. Here is a quick, partial roundup of what changed since the last update. (more…)
In Delphi, you can overload functions, but doing so requires using the overload directive explicitly.
The following code declares two functions with the same name, one that will be invoked if you pass an integer, another that will be invoked you pass a string:
Closures, also known as “anonymous methods” in Delphi, are now supported by DWScript for the JavaScript CodeGen, with the same syntax as in Delphi:
Great SOPA blackout page from Wikipedia, being one the top worldwide site, this should generate more awareness than any other!
I usually avoid posting non-technical stuff, let SOPA be the exception that confirms the rule! As for a description of the problems of SOPA, see:
The compiler supports writing “asm” aka JavaScript section in the middle of Object Pascal, there are a few good practices as well as tips to keep in mind, let’s review the menu:
Jon Lennart Aasenden just posted on G+ several links to new “How do I” entries in the OP4JS Documentation:
You may also want to read Primoz Gabrijelcic’s article “First Steps with Smart Mobile Studio“.
The DelphiTools.info website has just been relocated, it also transitioned from a Linux host to a Windows one.
There were a few glitches with WordPress during the transfer, but they should hopefully have been solved, if not, feel free to post about them here!
Just committed to the SynEdit SVN a few enhancements:
edit 27/12: committed another optimization, AFAICT, when working on large files, SynEdit is now faster than the Delphi IDE code editor and *way* faster than Scintilla/notepad++ 5.9.6.2 (with and without a syntax highlighter like DWS’s)
We’ve now sent “Smart Mobile Studio” Alpha version to 50 testers.
Did you miss the beta invite?
Visit www.SmartMobileStudio.com to participate.
SmartMobileStudio leverages DWScript’s JavaScript CodeGen.
My first test app with the alpha was a clock, check it in your iOS or Android Browser or in the Android market. Source is included in the alpha. Will be beautified it later on 🙂
I’ve been playing on another one, head over to YouTube to see a small video, you can also get the apk (47 kB), but beware it’s basic, ugly, and definitely early alpha, but it’s coded in Pascal!
Below is a snippet of the source code (using DWS inline implementations for illustration and compactness purposes, most of OP4JS is written in the more classic interface/implementation style), it’s a snip of the root class of the mini-engine of the game (yes, virtual methods are supported):
type
TEntity = class
X, Y : Float;
function Progress : Boolean; virtual;
begin
// does nothing by default
end;
constructor Create(aX, aY : Float);
begin
X := aX;
Y := aY;
end;
function Dist2(entity : TEntity) : Float;
begin
Result := Sqr(X-entity.X)+Sqr(Y-entity.Y);
end;
end;