You are not logged in.
Pages: 1
Hello! I'm evaluating mORMot and SMS 3 for a new project.
I tried the CopySynCrossPlatformUnits.bat file to copy the required .pas files to SMS but the locations appear to be wrong. I then copied the files manually to “C:\ProgramData\The Smart Company\Smart Mobile Studio\Libraries” and then SMS was able to find them.
When compiling the mORMotClient.pas file I get the following errors:
Syntax Error: Unit "System.Date" referenced in unit "SynCrossPlatformSpecific" not found [line: 100, column: 12, file: SynCrossPlatformSpecific]
Syntax Error: const parameter cannot have a default value [line: 804, column: 31, file: SynCrossPlatformREST]
Syntax Error: Unknown name "encodeURIComponent" [line: 1439, column: 13, file: SynCrossPlatformREST]
What am I doing wrong?
Thank you.
Offline
Maybe I'm not the right guy to help with this...
The mORMotClient.pas seems Ok.
The compilation errors are on the SynCrossPlatformSpecific.pas and SynCrossPlatformREST.pas.
System.Date seems to have been renamed to System.DateUtils?
The VarIsValidRef function does not exists anymore (or so it seems).
The decodeURIComponent function is now part of the class TString, TString.decodeURIComponent.
And finally, this function: function Add(Value: TSQLRecord; SendData: boolean; ForceID: boolean=false; const FieldNames: string=''): TID; virtual;
Is triggering: Syntax Error: const parameter cannot have a default value [line: 804, column: 46, file: SynCrossPlatformREST]
Is there a way to produce a js file to use on a VUE/REACT application? Put in another way, what is the best approach to build a client web app, other than using SMS?
I'm very new to this ORM and things, but I'm liking it so far.
Offline
For vue/react app this topic will help - https://synopse.info/forum/viewtopic.php?id=4740
Or you can use fetch (ajax) directly from the browser side without any classes.
Offline
Nice, I will experiment with that today, thank you.
Offline
I'm going through the same mistakes, testing SMS 3.
Is anyone using mORMot + SMS 3?
Ubaltino Faleiro
www.sistemainteligente.com
Brasil - Goiás - Goiânia
Offline
In fact, there is minor issue/bug on older SMS versions 1.2 | 2.0 | 2.0.1 | 2.2 and 2.2.2 - the TObject::Destroy method would just delete the property named "prop" rather than the actually all the properties of the object itself. For instance, obj.Free is doing nothing because the method Destroy was buggy.
var TObject={
(...)
Destroy: function (s) { for (var prop in s) if (s.hasOwnProperty(prop)) delete s.prop },
Destroy$: function(s) { return s.ClassType.Destroy(s) },
(...)
}
Look it should be: delete s[prop] --> It will remove all properties from JavaScript object itself. The delete operator is more about freeing memory than deleting an element. This issue was fixed on the DWScript trunk. On newer SMS version 3.x, they fixed the TObject::Destroy method.
Some changes are needed on the SynCrossPlatform units, Eric Grange has made some changes on the DWscript, nowadays, in my tests, it compiles and works in both SMS 2.2.2.04694 (lastest WinXP compatible) and SMS 3.1.0.80 (development version)!
I forgot to say, the examples 27 and 29 (specific SMS) should be updated on the current mORMot branch. There is an issue at the example 29. When you open the project, there's an ugly message: "Error while loading project file with the message: WebForm.pas doesn't exist". So, you can not open the project 29, because there's an bug in the SMS 2.x (Make Project/Item external) this issue, you can miss units on the project.
Last edited by warleyalex (2019-01-24 12:35:50)
Offline
I download the mORMot_and_Open_Source_friends_234301_06b24ae728 today and patched some needed SynCrossPlatform units and mORMotWrappers (generate mORMot cross-platform clients code from the server). and some changes at the project 27 and 29 are required to work at both both 2.x and 3.x,
Now, it compiles and works in both SMS 2.2.2.04694 (lastest WinXP compatible) and SMS 3.1.0.80 (development version)!
download link: https://www.dropbox.com/s/d4y6wkdtrurcc … 3x.7z?dl=0
Offline
here is pull request (merged with latest mORMot) https://github.com/synopse/mORMot/pull/183 extracted from warleyalex archive.
Without improved examples - I have only SMS free compiler so examples are not validated by me. I was able to compile some small project with latest SMS compiler.
Thanks warleyalex!
best regards,
Maciej Izak
Offline
Pages: 1