Welcome, Guest
Username: Password: Remember me
Components and Libraries for Web Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

js and TStringList 1 year 1 month ago #18113

  • Vbxler
  • Vbxler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 68
  • Thank you received: 4
Hello everyone,
I'm currently doing my first steps with pas2js.
Isn't it allowed to use TStringList for js?

I can compile the following code, but when running
it in the browser I get the error message: 'file error'
procedure TWForm1.FormCreate(Sender: TObject);
var
  slDaten   : TStringList;
  sFilename : string = '../data_mess/data_01.csv';
begin

  try
    try
          slDaten := TStringList.Create;

          // Load the file
          slDaten.LoadFromFile(sFilename);
       except
      ShowMessage('file error');
       end;
  finally
    slDaten.Free;
  end;
end;
The path to the CSV file is correct.

Thanks for the help!

Please Log in or Create an account to join the conversation.

js and TStringList 1 year 1 month ago #18117

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1114
  • Thank you received: 165
Please look at

codetyphon\CodeOcean\js_Pas2JavaScript\js_BaseRTL\10_rtl\demoloadstringsfromurl.ctpr
and
codetyphon\CodeOcean\js_Pas2JavaScript\js_BaseRTL\10_rtl\demoloadstreamfromurl.ctpr

These sample need HTTP Server in options

 
PilotLogic Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

js and TStringList 1 year 1 month ago #18120

  • Vbxler
  • Vbxler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 68
  • Thank you received: 4
Thanks for pointing out these examples, I didn't see them.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1