You are not logged in.
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
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
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
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
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 This very complex issue was solved with a simple nil
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
Thanks a lot for the fix!
Should be part of http://synopse.info/fossil/info/739c2d4d83
Offline