#1 2015-04-26 14:14:58

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

SmartMS 2.2.0.3999 with mORMot throws an exception

I can't use anymore crossplatform with smart v2.2.0.3999 anymore. Now, I'm getting this this nasty error:

Compilation failed [Failed to build project: Internal error. Code-generator threw exception EVariantInvalidOpError with message Invalid variant operation] error

some changes at SynCrossPlatformREST:

const
  /// the first field in TSQLFieldBits is always ID/RowID
  //ID_SQLFIELD: TSQLFieldBit = 0;
  ID_SQLFIELD: TSQLFieldBit = TSQLFieldBit(0);


constructor TRTTIPropInfos.Create(const PropNames: array of string;
  const PropKinds: array of TSQLFieldKind);
var name: string;
    p: integer;
    prop: TSQLModelInfoPropInfo;
begin
  prop := new TSQLModelInfoPropInfo;
  prop.Name := 'RowID'; // first Field is RowID
  Props.Add(prop);
  for name in PropNames do begin
    prop := new TSQLModelInfoPropInfo;
    prop.Name := name;
    Props.Add(prop);
  end;
  PropCache := new JObject;
  for p := 0 to high(Props) do begin
    prop := Props[p];
    prop.FieldIndex := TSQLFieldBit(p);
    if (p>0) and (p<=length(PropKinds)) then
      prop.Kind := PropKinds[p-1] else
      prop.Kind := sftUnspecified;
    PropCache[uppercase(prop.Name)] := prop;
  end;
end;

Offline

#2 2015-04-27 09:35:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

Yes...
The new version broke some things at the language level.

I would like the 2.2 revision to be stabilized before supporting it fully.

Your feedback is welcome!

Offline

#3 2015-05-11 14:19:05

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

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

I can see a little light what's raising this nasty Compilation failed [Failed to build project: Internal error. Code-generator threw exception EVariantInvalidOpError with message Invalid variant operation] error with SmartMS2.2

The following code bellow, I can compile successfully using Smart2.1, but not with Smart2.2.

Code to reproduce:

procedure TForm1.W3Button1Click(Sender: TObject);
var Call: TSQLRestURIParams;
begin
  CallBackGetB('Auth',['UserName','fAuthentication.User.LogonName','Session','fAuthentication.SessionID'],Call);
end;

procedure TForm1.CallBackGetB(const aMethodName : String;
                                const aNameValueParameters: array of const;
                                var Call: TSQLRestURIParams;
                                aTable: TSQLRecordClass=nil;
                                aID: TID = 0);
begin{ }end;

Ref. SynCrossPlatformREST unit from procedure TSQLRestClientURI.SessionClose

Offline

#4 2015-05-11 16:05:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

Did you ask for support in the SMS forums?

Offline

#5 2015-05-11 18:21:09

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

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

ab wrote:

Did you ask for support in the SMS forums?

Their forums usually does not give you feedback, it seems really inactive. Anyway, I've started a new thread
http://forums.smartmobilestudio.com/ind … nal-error/

Offline

#6 2015-05-26 21:56:38

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

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

Hi there,
Smartmobile team have deleted my thread http://forums.smartmobilestudio.com/ind … nal-error/ I asked support to smartmobile team about project WebForm, and a guy named Primoz Gabrijelcic said that he successfully can compile the project using SmartMS 2.2.0.3999 beta2.

Here is the full source attacked.
https://smartmobilestudio.zendesk.com/a … ebForm.zip

Unfortunately, in my old Windows XP SP3, I always I get this internal error Message: Compilation failed [Failed to build project: Internal error. Code-generator threw exception EVariantInvalidOpError with message Invalid variant operation] error

Apparently, this project is working fine under Windows 7, but can not confirm this.

Last edited by warleyalex (2015-05-26 21:59:24)

Offline

#7 2015-06-04 13:02:32

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

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

I spent hours to solve this obscure error Compilation failed [Failed to build project: Internal error. Code-generator threw exception EVariantInvalidOpError with message Invalid variant operation] error and finally SMS Client 2.1 and 2.2 worked flawless for me smile This very complex issue was solved with a simple nil sad

Passing a value to the method, any expected value, even nil, overrides the default. If you want the default,
omit the argument. The default parameter is used when the parameter isn't provided, but this behavior does not always occur with Smart 2.2, the compiler spits this nasty error, I found that you have explicitly to pass nil argument when a method signature is complex.

Patch for Crossplatform files, project27, project 29:
https://www.dropbox.com/s/7n1jl1a56xeqo … s.rar?dl=0

Last edited by warleyalex (2015-06-04 13:04:40)

Offline

#8 2015-06-04 18:08:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: SmartMS 2.2.0.3999 with mORMot throws an exception

Thanks a lot for the fix!

Should be part of http://synopse.info/fossil/info/739c2d4d83

Offline

Board footer

Powered by FluxBB