* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Project raises exception class "External SIGSEGV"
« Last post by passt on Today at 01:29:29 pm »
which raises the question where is your application raising the exception? What is the debugger saying?
When I change the code so that the problematic line is shown in Unit1 and removed from Unit2, there is no error shown.
But when I set a breakpoint at the problematic line, the debugger shows "Error: Type TSTRINGLIST has no component named COUNT".
Code: Pascal  [Select]
  1. unit Unit1;
  2. {$mode objfpc}{$H+}
  3. interface  
  4. ...
  5. var
  6.   slFLartikel: TStringlist;
  7. implementation
  8. uses
  9.   Unit3;
  10. {$R *.lfm}
  11. { TForm1 }
  12.  
  13. procedure TForm1.myproc1();
  14. begin
  15.   slFLartikel := TStringlist.Create;
  16.   myproc2;
  17.   //Form2.show;
  18.   For i := 0 to slFLartikel.Count-1 do showmessage(slFLartikel[i]);
  19.   slFLartikel.free;
  20. end;
  21.  
  22. procedure TForm1.myproc2
  23. begin
  24.   while ... do slFLartikel.Add(someString);
  25. end;
  26.  
  27. ###
  28. unit Unit2;
  29. {$mode objfpc}{$H+}
  30. interface  
  31. ...
  32. implementation
  33. uses
  34.   Unit3;
  35. {$R *.lfm}
  36. { TForm2 }
  37.  
  38. procedure TForm2.myproc3();
  39. begin
  40. //  For i := 0 to slFLartikel.Count-1 do showmessage(slFLartikel[i]);
  41. end;
  42.  
  43. ###
  44. unit Unit3;
  45. {$mode objfpc}{$H+}
  46. interface
  47. uses
  48.   Classes, SysUtils;
  49. var
  50.   slFLartikel: TStringlist;
  51. implementation
  52.  
  53. end.
2
General / Re: Project raises exception class "External SIGSEGV"
« Last post by passt on Today at 01:23:38 pm »
Yes this is my project file exactly.
slFLartikel is now declared as a global variable in Unit3. Unit3 isn't shown in the begin..end section of the project file, because it doesn't have a Form. However Unit3 is shown in the uses section of the project file where I changed the order to avoid this error, but it still remains.

Code: Pascal  [Select]
  1. program MyProgram;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Interfaces, // this includes the LCL widgetset
  10.   Unit3, Forms, Unit1, Unit2
  11.   { you can add units after this };
  12.  
  13. {$R *.res}
  14.  
  15. begin
  16.   RequireDerivedFormResource:=True;
  17.   Application.Initialize;
  18.   Application.CreateForm(TForm1, Form1);
  19.   Application.CreateForm(TForm2, Form2);
  20.   Application.Run;
  21. end.
3
General / Re: Project raises exception class "External SIGSEGV"
« Last post by Munair on Today at 12:34:34 pm »
The error can occur if your forms are created at startup and one of your form create procedures tries to access (populate) slFLartikel before it is instantiated. For example, in your project file (lpr) you should see something like this:
Code: Pascal  [Select]
  1. begin
  2.   RequireDerivedFormResource:=True;
  3.   Application.Initialize;
  4.   Application.CreateForm(TForm1, Form1);  // Form1.Create invoked
  5.   Application.CreateForm(TForm2, Form2);  // Form2.Create invoked
  6.   Application.Run;
  7. end.
But without full code this remains guess work.
4
Databases / Re: Noob and JSON
« Last post by madref on Today at 12:33:35 pm »
5
Databases / Re: Noob and JSON
« Last post by JD on Today at 12:18:50 pm »
This is still Abracadabra for me.


Isn't their an easier way?

Like Leledumbo said earlier, it is just a simple 3 tier application: database access, a server with JSON serialization over HTTP/TCP and a desktop client to talk to the server. It is relatively easy to do this with Indy (using IdHTTP or IdTCP transport), mORMot (REST & HTTP) or even FPC's built in default HTTP/TCP units.

If you want something simpler (drag and drop), I suggest you look at REST Dataware drag and drop components. Even if the author is Brazilian and his YouTube videos are in Portuguese, the images speak for themselves. That is the simplest method I know of.

REST Dataware links
REST Dataware Componentes: http://forum.lazarus-ide.org/index.php/topic,38281.msg259512.html#msg259512
My New Project Lazarus REST/JSON Server/Client: http://forum.lazarus-ide.org/index.php/topic,36290.msg250356.html#msg250356
Youtube videos: https://www.youtube.com/watch?v=6FVXT36j-7U
Sourceforge: https://sourceforge.net/projects/rest-dataware-componentes/?source=directory

Alternatively, you can download and install REST Dataware using the Lazarus Online Package Manager. See screenshot.

Cheers,

JD
6
Android / LAMW - Compilation Error ("Cannot find system ..")
« Last post by BjPascal on Today at 12:13:32 pm »
using Lazarus 1.9.0  and FPC 3.1.1 on Win7 x64

Just installed Android stuff by using laztoapk, all went fine.

Now I created my first LAMW project, and get this error:
Cannot find system used by controls. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=C:\fpcupdeluxe\fpc\units\arm-android\rtl\system.ppu..

Any idea how to fix it?
I read older posting with the same problem, but they did not help.



7
General / Re: Python struct.pack equivalent anyone?
« Last post by cday on Today at 12:10:15 pm »
Oh the output from that bit of python code is 07b1a8b9122b6f2d
8
General / Re: Python struct.pack equivalent anyone?
« Last post by cday on Today at 12:06:01 pm »
FWIW, this is the full python script I'm trying to replicate in Lazarus:
Code: Pascal  [Select]
  1. from Crypto.Cipher import ARC2
  2. import struct
  3.  
  4. serial = 100377
  5. serial2 = 30
  6. option = 56
  7. record = struct.pack("<II", serial, serial2 + (option <<20))
  8. encyphered = ARC2.new("Revision\0").encrypt(record)
  9. print encyphered.encode("hex")
  10.  

But I'm having issues trying to work out how to implement it using FPC crypto classes. From what I have read, ARC2 is the same as RC2. I've had a play but really have not much idea what I'm doing..
9
General / Re: Project raises exception class "External SIGSEGV"
« Last post by taazz on Today at 12:03:18 pm »
I don't think this is right - for my case. The shortened code is nearly exact for this issue. But the error happens when I start the program and before any Form is shown. So there isn't any access to the variable slFLartikel.
which raises the question where is your application raising the exception? What is the debugger saying?
10
General / Re: Project raises exception class "External SIGSEGV"
« Last post by passt on Today at 11:53:57 am »
I don't think this is right - for my case. The shortened code is nearly exact for this issue. But the error happens when I start the program and before any Form is shown. So there isn't any access to the variable slFLartikel.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus