Jump to content

ron

Members
  • Content Count

    31
  • Joined

  • Last visited

  1. ron

    new Json file

    When you want to add a new Json in the project manager.. you can't remove or rename it!.. smart mobile studio 2.2.2.4543
  2. ron

    Savetostring issue in TW3Dataset

    Same thing with the LoadFromString Procedure.. Procedure TW3Dataset.LoadFromString(Const aText:String); var mHead: TW3DatasetHeader; Begin (* If the dataset is active, close it down *) if FActive then Close; (* Check source string *) if aText.Length>0 then Begin (* Attempt to de-serialize JSON data *) try asm @mHead = JSON.parse(@aText); end; except on e: exception do Raise EW3Dataset.CreateFmt(CNT_ERR_DATASET_FailedLoad,[e.message]); end; (* Verify header *) if mHead.dhMagic=$CAFE then Begin (* Load DEFS if any *) if mHead.dhFieldDefs.Length>0 then FDefs.LoadFromString(DecodeURI(mHead.dhFieldDefs)); (* Any actual rows? ok, try to load them *) if mHead.dhCount>0 then Begin try asm (@self).FCache = JSON.parse((@mHead).dhData); end; except on e: exception do Raise EW3Dataset.CreateFmt(CNT_ERR_DATASET_FailedLoad,[e.message]); end; end; end else Raise EW3Dataset.Create(CNT_ERR_DATASET_LoadInvalidSignature); end else Raise EW3Dataset.Create(CNT_ERR_DATASET_LoadInvalidSource); end; replace asm (@self).FCache = JSON.parse((@mHead).dhData); end; with asm @FCache = JSON.parse((@mHead).dhData); end;
  3. As i mention in this topic (couldn't delete it) http://forums.smartmobilestudio.com/index.php?/topic/4259-dataset-savetostring/ unit Form1; interface uses SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms, SmartCL.Fonts, SmartCL.Borders, SmartCL.Application, System.Dataset; type TForm1 = class(TW3Form) mDataset :TW3Dataset; Procedure TestDataset; private {$I 'Form1:intf'} protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; implementation { TForm1 } Procedure TForm1.TestDataset; var mDataset: TW3Dataset; x:Integer; mId: Integer; begin mDataset:=TW3Dataset.Create; try mDataset.FieldDefs.add('id',ftAutoInc); mDataset.FieldDefs.add('key',ftGUID); mDataset.FieldDefs.add('name',ftString); mDataset.createDataset; for x:=1 to 50 do Begin mDataset.Append; mId:=mDataset.Fields.FieldByName('id').asInteger; mDataset.Fields.FieldByName('name').asString:='Data field #' + IntToStr(mId); mDataset.post; end; showmessage(mDataset.saveToString); finally mDataset.free; end; end; procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} TestDataset; end; procedure TForm1.Resize; begin inherited; end; initialization Forms.RegisterForm({$I %FILE%}, TForm1); end. the alertbox displayed; {"dhCount":50,"dhFieldDefs":"%7B%22ddMagic%22:3401235116,%22ddDefs%22:%5B%7B%22fdName%22:%22id%22,%22fdDatatype%22:6%7D,%7B%22fdName%22:%22key%22,%22fdDatatype%22:7%7D,%7B%22fdName%22:%22name%22,%22fdDatatype%22:4%7D%5D%7D","dhMagic":51966} The recordfields doesn't get saved in Savetostring.. Ron
  4. ron

    Dataset savetostring

    ok . thanks for testing..
  5. ron

    Dataset savetostring

    Sorry my question wasn't clear.. my alert box displayed. {"dhCount":50,"dhFieldDefs":"%7B%22ddMagic%22:3401235116,%22ddDefs%22:%5B%7B%22fdName%22:%22id%22,%22fdDatatype%22:6%7D,%7B%22fdName%22:%22key%22,%22fdDatatype%22:7%7D,%7B%22fdName%22:%22name%22,%22fdDatatype%22:4%7D%5D%7D","dhMagic":51966} but i don't see the updated records
  6. ron

    Dataset savetostring

    I was testing some code from Jon Lennart website, but it won't show the updated records when i call savetostring.. what am i missing??? https://jonlennartaasenden.wordpress.com/2014/07/10/dataset-for-smart-mobile-studio-update/ unit Form1; interface uses SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms, SmartCL.Fonts, SmartCL.Borders, SmartCL.Application, System.Dataset; type TForm1 = class(TW3Form) mDataset :TW3Dataset; Procedure TestDataset; private {$I 'Form1:intf'} protected procedure InitializeForm; override; procedure InitializeObject; override; procedure Resize; override; end; implementation { TForm1 } Procedure TForm1.TestDataset; var mDataset: TW3Dataset; x:Integer; mId: Integer; begin mDataset:=TW3Dataset.Create; try mDataset.FieldDefs.add('id',ftAutoInc); mDataset.FieldDefs.add('key',ftGUID); mDataset.FieldDefs.add('name',ftString); mDataset.createDataset; for x:=1 to 50 do Begin mDataset.Append; mId:=mDataset.Fields.FieldByName('id').asInteger; mDataset.Fields.FieldByName('name').asString:='Data field #' + IntToStr(mId); mDataset.post; end; showmessage(mDataset.saveToString); finally mDataset.free; end; end; procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} TestDataset; end; procedure TForm1.Resize; begin inherited; end; initialization Forms.RegisterForm({$I %FILE%}, TForm1); end.
  7. ron

    Unused CSS feature

    I use Autoprefixer a lot. it deals with different vendors.. http://autoprefixer.github.io/
  8. ron

    Inactivity

    Maybe i'm pessimistic but looks to me every teammember has taken his own road.... hexlicense and quartexcomponents is a product from john Lennart Aasenden.. i rather see a update of SMS.
  9. ron

    input type="file" not working on iOS9 (iPad)

    thanks ..i will try that..
  10. ron

    input type="file" not working on iOS9 (iPad)

    I have the same problem..is there a workaround?
  11. ron

    PhoneGap / Cordova: How to use PlugIns?

    i made a quick and messy example how to use phonegap build.. it uses the camera plugin and the file plugin... copy a picture to a new destination and rename the picture.. maybe its helps you.. ron phonegaptest.zip
  12. I just found https://github.com/SmartMobileStudio... a lots of wrappers made by Christian Budde.. keep up the good work!!! Ron
  13. ron

    Resize event

    Thank you for the detailed explanation, it's clear to me now.. Ron
  14. ron

    Resize event

    Hi, can anyone tell me why the resize event executes 3 times and when you wait another 15 sec the event executes again.. Ron Form1.zip
  15. ron

    w3_getIsSafari

    Hi Igor You could try Rob W ducking typing method.. http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser/34840631#34840631 I know SMS w3_getIsInternetExplorer detection fails also for internet explorer 11.. since the user agent no longer contains MSIE Ron
×