Jump to content

Igor Savkic

  • Content count

  • Joined

  • Last visited

  • Days Won


Igor Savkic last won the day on July 31

Igor Savkic had the most liked content!

About Igor Savkic

  • Rank

Smart Mobile Studio

  • Edition

Recent Profile Visitors

214 profile views
  1. Igor Savkic

    Save tw3image to desktop?

    It should be doable, you create link, point your image to it and click it. Here is an example of that tehnique: https://jonlennartaasenden.wordpress.com/2017/01/20/smart-pascal-download-streams/
  2. Igor Savkic

    editbox to allow a subset of characters only

    Yes, standard Delphi behaviour is preferred, just document it for others without Delphi background.
  3. Igor Savkic

    Database connectors - what to choose ?

    I haven't tried SMS in combination with DataSnap/RemObjects but I have in combination with mORMot. Speedwise it's at the moment fastest available combination for data handling or displaying. In case you can serve pages filled with data on server side then you can handle all on mORMot side. Problem is high learning curve for both mORMot and SMS, so if you need a fast solution then some other solutions may be better fit. If you can spend more time on development you can get great results.
  4. Igor Savkic

    Confused on variants

    //compiles but gives execution error : Uncaught TypeError: MyList1.Business.Depts[0].Staff.add is not a function MyList1.Business.Depts[0].Staff.add('st4'); //works. Why does 'push' work but 'add' doesn't ? MyList1.Business.Depts[0].Staff.push('st5'); AFAIU you're working here with raw Variant and Staff is JS array object that doesn't have add function defined only push: //lowercase 'staff'. Compiles but gives execution error : Uncaught TypeError: Cannot read property 'push' of undefined MyList1.Business.Depts[0].staff.push('st6'); JS functions and properties are case sensitive so there's no staff defined only Staff.
  5. Igor Savkic

    Obfuscation To Protect Code

    Try Google obfuscation (https://developers.google.com/closure/compiler/) but sometimes SMS project doesn't work after it's processed. For really sensitive algos or data, I guess best way to protect it would be to move it to a server side and let SMS client just download minimum that's required for display.
  6. Igor Savkic

    Save Content Dialog

    I don't know about displaying File Save dialog but you can create a hidden a (nchor) element and use it to download file. Take a look at here, it's nicely explained: https://jonlennartaasenden.wordpress.com/2017/01/20/smart-pascal-download-streams/
  7. Igor Savkic


    > stringifying this (asm @textdata = JSON.stringify(@data); where @data refers to JA) gives what I was after. > Except that all fieldnames in the result-string have a '$1' appended ({"field1$1"). No idea why that happens or how to avoid that. I would bet on obfuscation mechanism, try declaring all your fields with property: JB = record property field1: string; property params: Array of JC; end;
  8. Igor Savkic

    sqLite's TSQLiteResult Values

    fListBox.Add(fData.values$1); //doesn't work Try in asm, it's allowed to use such property names like: asm @Temp = @fData.values$1; FListBox.Add(ReadItem(Temp));
  9. Igor Savkic

    sqLite's TSQLiteResult Values

    > that gives me the same result > [{"values$1":["WS0202","Maintenance","jdoe"]}] > I need to be able to get the individual data, WS0202, Maintenance, jdoe OK, so you first have array where elements are objects that have string array called "values$1". Try something like: var v: Variant; i: Integer; procedure ReadItem(const AValue: Variant); var i: Integer; begin for i := 0 to AValue.length - 1 do WriteLn(AValue[i]); end; begin v := JSON.Parse('[{"values$1":["WS0202","Maintenance","jdoe"]}]'); for i := 0 to v.length - 1 do ReadItem(v[i].values$1); end;
  10. Igor Savkic

    sqLite's TSQLiteResult Values

    > writeln(JSON.Stringify(sqlResult.Values)); > Syntax Error: Argument 0 expects type "Variant" instead of "array of record TSQLiteRowValues" [line: 98, column: 30, file: frmMain] Try casting to Variant like: writeln(JSON.Stringify(Variant(sqlResult.Values))); or otherwise use asm to assign sqlResult.Values to some Variant variable, something like: asm @Temp = @sqlResult.Values; end; > writeln(JSON.Stringify(sqlResult.Values[0])); > gives me the json structure, but how do i get to the individual data values It's easy if you know structure, how does it look like? On unrelated note, is there any way to control formatting in this forum editor, my reply really looks bad but I don't see a way to change a simple thing.
  11. Igor Savkic

    sqLite's TSQLiteResult Values

    Try to see what JS structure it really has, for example WriteLn(JSON.Stringify(sqlResult.Values)); WriteLn(JSON.Stringify(sqlResult.Values[0]));
  12. Igor Savkic

    sqLite's TSQLiteResult Values

  13. Igor Savkic

    IDE Component Issue ?

    > Is anyone else experiencing an issue with the default sizing of components when placed on a form consecutively? I think I've seen it too in old SMS couple of times, my guess is that during drag drop, SMS treats pressed mouse as request to resize control and depending on how you drop it and move mouse it shrinks.
  14. Igor Savkic

    problem, maybe...

    > In the current ALPHA, you are also able to define custom "width"/"height" values for > TApplication.ShowDialog calls. Also consider adding AutoSized dialog. In most cases one would change default width/height when text that's showing is too big so he'll use GetTextWidth/Height to get true size and adjust dialog size accordingly.
  15. Igor Savkic


    > Yes, i've used OnKeyDown on mainform. but calling setfocus in InitializeForm gives no result. Are you using new alpha? If so, perhaps you need to flag that you intend to listen for keys, I know it's mandatory for custom controls to add cfKeyCapture to CreationFlags, but I'm not sure about added forms and controls on it, check. Alternative is of course to just use MYForm.Handle.addEventListener and make a classic JS event.