#151 Re: mORMot 1 » Problem to create Query Params for MS-SQL RetrieveDocVariantArray » 2019-08-02 08:15:49

I think that DateTimeToSQL and DateToSQL functions (SynTable module) can help you to build proper where clause.
I don't know, whether it is the best way. I would be pleased to know an easier way wink

#152 Re: mORMot 1 » JSONToObject for object with dynamic array of double » 2019-07-17 17:04:47

Oh, that's fine! TDoubleDynArray works totally good for me, thank you! smile

#153 Re: mORMot 1 » JSONToObject for object with dynamic array of double » 2019-07-17 15:45:21

ah, thanks, it is pretty much the same as printed in LResult:

((4,94065645841247e-323, 2,91498731046335e-322, 5,43472210425371e-323, 3,4090529563046e-322, 5,92878775009496e-323, 3,90311860214585e-322))

couldn't find ability to post a screen - the value of LObject is copied from local variables watch list

#154 Re: mORMot 1 » JSONToObject for object with dynamic array of double » 2019-07-17 14:14:00

ab wrote:

What is the LObject content?

LObject is just:

LObject := TJSONObjectWithArray.Create;

The class is:

  TJSONObjectWithArray = class(TSynPersistent)
  private
    FArrayOfFloat: TJSONArrayOfFloat;
  published
    property ArrayOfFloat: TJSONArrayOfFloat read FArrayOfFloat;
  end;

Or maybe I misunderstood your question... Can you specify, please, what do you mean?

#155 mORMot 1 » JSONToObject for object with dynamic array of double » 2019-07-16 21:30:19

Vitaly
Replies: 6

I've faced some problem with deserialization JSON, which has a dynamic array of floating-point values inside one of the json-objects.
My JSON has a very complicated structure, but I'll provide here a simple example, showing my trouble.

  TJSONArrayOfFloat = array of double;

  TJSONObjectWithArray = class(TSynPersistent)
  private
    FArrayOfFloat: TJSONArrayOfFloat;
  published
    property ArrayOfFloat: TJSONArrayOfFloat read FArrayOfFloat;
  end;

...

procedure TForm1.FormShow(Sender: TObject);
var
  i: integer;
  LJSON: RawUTF8;
  LObject: TJSONObjectWithArray;
  LDeserResult: boolean;
  LResult: string;
begin
  LJSON := StringToUTF8
    ('{"arrayoffloat": [10.387747, 59.377930, 11.388159, 69.377976, 12.388261, 79.377988]}');
  LObject := TJSONObjectWithArray.Create;
  JSONToObject(LObject, pointer(LJSON), LDeserResult);
  if LDeserResult then
  begin
    LResult := 'Array: ';
    for i := 0 to High(LObject.ArrayOfFloat) do
      LResult := LResult + '   ' + FloatToStr(LObject.ArrayOfFloat[i]);
  end
  else
    LResult := 'Deserialization error!';
  FreeAndNil(LObject);
  Memo1.Text := LResult;
end;

The result values are nearby 0:

Array:    4,94065645841247E-323   2,91498731046335E-322   5,43472210425371E-323   3,4090529563046E-322   5,92878775009496E-323   3,90311860214585E-322

The same result I get with type single (with lower precision).

But if I use integer dynamic array JSONToObject works fine:

  TJSONArrayOfFloat = array of integer;
Array:    10   59   11   69   12   79

Delphi 10.3.1 64. Also checked this code with FPC but no luck.

#156 Re: mORMot 1 » What's the correct way to connect a https-enabled mORMot rest server? » 2019-03-21 17:20:35

Yep, that's working good, and constructor using looks even better than NewSQLHttpClient using smile Thanks!

#157 Re: mORMot 1 » What's the correct way to connect a https-enabled mORMot rest server? » 2019-03-21 15:47:02

Well, maybe you are right - I'm not so experienced in such constructions.

But, anyway, in Delphi VCL the function works fine with the suggested code, and the original function fails with AV in inherited TSQLRest.Create(aModel: TSQLModel) constructor

I'm not insisting on updating your code wink I've already created the copy of function and using it in my project - just worried about others, who can face the same problem

#158 Re: mORMot 1 » What's the correct way to connect a https-enabled mORMot rest server? » 2019-03-21 14:46:14

edwinsn wrote:

But I guess the global NewSQLHttpClient function still has the Access Violation issue.

I think you are right. I guess I found a mistype in NewSQLHttpClient function. There we have:

result := TSQLHttpClientRequest(TSQLHttpsClient).Create(aURI.Server, aURI.Port, aModel,
      aURI.Https, AnsiString(aProxyName), AnsiString(aProxyByPass));

I suppose, that there is some tiny mess with the brackets wink

The correct code should be:

result := TSQLHttpClientRequest(TSQLHttpsClient.Create(aURI.Server, aURI.Port, aModel,
      aURI.Https, AnsiString(aProxyName), AnsiString(aProxyByPass)));

upd: I've created a pull request for that

#159 Re: mORMot 1 » Smart Mobile Studio » 2018-05-04 22:04:20

warleyalex wrote:

This is a very experimental SMS + F7 + mORMot
Compiled with SMS Basic Version (v2.1.0.3592)

https://www.dropbox.com/s/zwpwqa2fh1k1u … 7.rar?dl=0

Can anybody reshare this source code? the link does not work anymore sad
If not, analogous example would be very good, too. Please!

#160 Re: mORMot 1 » Smart Mobile Studio supported or not?? » 2018-04-25 13:18:12

Glad to confirm that with old mORMot 2016/09/01 (https://synopse.info/fossil/info/ddc1dc391a173bfc) SMS examples work fine. Also tried 2016/09/15, but failed.
Now I can begin diging in mobile development. Thanks again, you are the savior of my professional enthusiasm wink

igors233 wrote:

> Depending on what kind of mobile app you're looking, Elevate WebBuilder may be a good choose as well, it has a more finished UI controls to start with. For mobile where you want a complete control and you're not affraid of doing more work SMS is best.

I like control and more work was never problem for me, if the result is worth it. So, I hope that SMS is rather good for my start wink

#161 Re: mORMot 1 » Smart Mobile Studio supported or not?? » 2018-04-24 16:59:46

igors233 wrote:

Are you having a Delphi server side built in mORMot and client in SMS?

I have FPC server and several FPC desktop apps with ORM access. But I have no any mobile client yet.
That is the thing, I chose mORMot to migrate to, because I supposed (while reading docs) that it would be easiest way to cover mobile needs for my users (unfortunately I have no any valuable experience in that field). Nowadays I've finished redevelopment of my project, i've got much more possibilities and speedup with mORMot, but still can't make my mobile app sad

igors233 wrote:

I think you could make it work by using latest mORMot for Delphi and older one for SMS, authentication and interface based request should work OK.

That's a great idea! I'll definitely try it as soon as possible. Thank you!

igors233 wrote:

> SMS 2.2.2.4543 - got same errors in SynCrossPlatformREST.
Which ones, perhaps they're some easy to fix ones?

The same as in https://synopse.info/forum/viewtopic.php?id=4318 . Starting from:
Syntax Error: const parameter cannot have a default value [line: 804, column: 31, file: SynCrossPlatformREST]
on the line:

function Add(Value: TSQLRecord; SendData: boolean; ForceID: boolean=false;
      const FieldNames: string=''): TID; virtual;

#162 Re: mORMot 1 » Smart Mobile Studio supported or not?? » 2018-04-24 14:44:28

Yes, I'm using fresh mORMot (and I'm affraid that I can't downgrade it so much because of using fresh Zeos). SMS 2.2.2.4543 - got same errors in SynCrossPlatformREST.
Nevertheless, thank you very much for your response!

#163 Re: mORMot 1 » Smart Mobile Studio supported or not?? » 2018-04-24 13:46:30

igors233 wrote:

Current (alpha) version of SMS doesn't work with mORMot but version from year ago is running fine (I use it myself daily).

Great! Can you name the version, please? I tried 2.2 (07.04.2016) - got same errors as in alpha or beta 3.0.

#164 mORMot 1 » Smart Mobile Studio supported or not?? » 2018-04-24 12:37:41

Vitaly
Replies: 33

Hello, everybody!

I wonder if the whole chapter https://synopse.info/files/html/Synopse … ml#TITL_90 is worth to be deleted?
I spent a lot of time studing docs and forum and finally coudn't even get the SMS compiler, which can work with samples, delivered from mORMot.

#165 Re: mORMot 1 » mORMot and current FPC trunk doesn't work » 2017-01-31 17:13:42

AOG wrote:

You can use fpcupdeluxe to install only NewPascal FPC.
Then point CT towards this FPC.

Thank you, I'll try it. Can you prompt me how to "point CT towards this FPC" correctly?

#166 Re: mORMot 1 » mORMot and current FPC trunk doesn't work » 2017-01-31 17:07:22

hnb wrote:

I have special version of mORMot which is *almost* ready and compatible both with current FPC trunk and with next NewPascal release:

https://github.com/maciej-izak/mORMot/tree/fpc_newrtti

Thank you very much! Your special mORMot version seems workable for me.

#167 Re: mORMot 1 » mORMot and current FPC trunk doesn't work » 2017-01-31 15:31:43

AOG wrote:

@Vitaly
Why not use NewPascal ? That is trunk !

I use CT. Unfortunately, It uses fpc trunk. Everything was ok before yesterday's CT 6.0 release.

#168 Re: mORMot 1 » mORMot and current FPC trunk doesn't work » 2017-01-31 02:45:40

hnb wrote:

At the moment we need to wait

The problem becomes very actual for me. Is there any hope that it will be solved soon?

Board footer

Powered by FluxBB