#1 2018-10-18 15:12:29

imperyal
Member
Registered: 2018-10-11
Posts: 25

Smart Mobile Studio 3 - Compilation error

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

#2 2018-10-18 15:24:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,182
Website

Re: Smart Mobile Studio 3 - Compilation error

Yes, we didn't make the templates compatible with SMS 3 yet...

Any input is welcome!

Offline

#3 2018-10-18 17:35:49

imperyal
Member
Registered: 2018-10-11
Posts: 25

Re: Smart Mobile Studio 3 - Compilation error

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

#4 2018-10-18 22:15:39

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,299
Website

Re: Smart Mobile Studio 3 - Compilation error

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

#5 2018-10-19 11:01:05

imperyal
Member
Registered: 2018-10-11
Posts: 25

Re: Smart Mobile Studio 3 - Compilation error

Nice, I will experiment with that today, thank you.

Offline

#6 2019-01-22 18:22:10

ubaltino
Member
From: Brasil
Registered: 2014-05-23
Posts: 24
Website

Re: Smart Mobile Studio 3 - Compilation error

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

#7 2019-01-23 08:27:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,182
Website

Re: Smart Mobile Studio 3 - Compilation error

There is no SMS 3 support 3 yet, sadly...

Offline

#8 2019-01-24 12:29:43

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio 3 - Compilation error

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

#9 2019-01-24 17:58:58

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio 3 - Compilation error

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)! 

SMS 3x

download link: https://www.dropbox.com/s/d4y6wkdtrurcc … 3x.7z?dl=0

Offline

#10 2019-01-25 14:29:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,182
Website

Re: Smart Mobile Studio 3 - Compilation error

Great news!

Offline

#11 2019-04-03 10:15:21

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Smart Mobile Studio 3 - Compilation error

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

Board footer

Powered by FluxBB