Re: [fpc-pascal] Compilation raised exception internally

2025-04-25 Thread Luca Olivetti via fpc-pascal
El 25/4/25 a les 14:24, Michael Van Canneyt via fpc-pascal ha escrit: Try to make sure you don't have circular references. It happens often in such cases. Ouch, that's probably it. I usually avoid circular references but in this project I have a couple, I'll either have to try to untangle

[fpc-pascal] Compilation raised exception internally

2025-04-25 Thread Luca Olivetti via fpc-pascal
Hello, recently I get a lot of these errors (i.e., I modify something, in lazarus click on "compile" or "run", and I get the error). If I then use "clean up & build.." the compilation ends without errors. I recently switched the virtual machine I use for windows development from virtualbox to

Re: [fpc-pascal] Adding command line parameter to GUI application?

2025-02-25 Thread Luca Olivetti via fpc-pascal
El 25/2/25 a les 21:28, Bo Berglund via fpc-pascal ha escrit: I want the program to load a video file if it appears in the command line so it can be immediately played rather than having to click the OpenFile button and navigate to the video and select it. Any ideas, suggestions, links? https

Re: [fpc-pascal] sqldb, copy table between databases is painfully slow

2025-02-18 Thread Luca Olivetti via fpc-pascal
El 18/2/25 a les 14:49, Michael Van Canneyt via fpc-pascal ha escrit: On Tue, 18 Feb 2025, Luca Olivetti via fpc-pascal wrote: Hello, I need to copy a table between an mssql database and a postgresql one. I used a query to obtain the data, a datasource ponting to it and another query using

[fpc-pascal] sqldb, copy table between databases is painfully slow

2025-02-18 Thread Luca Olivetti via fpc-pascal
Hello, I need to copy a table between an mssql database and a postgresql one. I used a query to obtain the data, a datasource ponting to it and another query using the datasource, the sql being INSERT INTO table (f1,f2,f3...) values (:f1,:f2,:f3,) and then doing OrigTable.Open; P

Re: [fpc-pascal] What to do to get new users

2024-12-02 Thread Luca Olivetti via fpc-pascal
El 2/12/24 a les 1:44, James Richters via fpc-pascal ha escrit: I've got the fpGUI examples working and had a look at how some of them work, and It's very impressive! I've made a few GDI windows with my Freepascal programs before, but they are clumsy and hard for me to follow.. there is a lot o

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-17 Thread Luca Olivetti via fpc-pascal
El 16/10/24 a les 5:00, Hairy Pixels via fpc-pascal ha escrit: Even if there is a market for Lazarus type apps people in 2024 don’t want to use a massive legacy IDE and prefer better tools like VSCode. I'm biased because I've been programming in pascal for almost 40 years, starting with line

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-17 Thread Luca Olivetti via fpc-pascal
El 17/10/24 a les 7:58, Hairy Pixels via fpc-pascal ha escrit: I used C# for Unity quite a bit and never had any problems. That’s even with the worst case scenario for game developing that needs real time graphics. Does that power all of .NET too and all those desktop applications? It’s been ba

Re: [fpc-pascal] Signing applications, how?

2024-08-10 Thread Luca Olivetti via fpc-pascal
El 10/8/24 a les 15:32, Bo Berglund via fpc-pascal ha escrit: On Sat, 10 Aug 2024 13:32:12 +0200, Luca Olivetti via fpc-pascal wrote: El 10/8/24 a les 11:28, Jeppe Johansen via fpc-pascal ha escrit: It's fairly straight-forward to use this on executables. You point it at the EXE an

Re: [fpc-pascal] Signing applications, how?

2024-08-10 Thread Luca Olivetti via fpc-pascal
El 10/8/24 a les 11:28, Jeppe Johansen via fpc-pascal ha escrit: It's fairly straight-forward to use this on executables. You point it at the EXE and the code signing certificate you will use. I guess you'll have to get ($$$) a valid signing certificate too. Bye -- Luca __

Re: [fpc-pascal] opening a serial port in a dll called from dot net fails

2024-03-11 Thread Luca Olivetti via fpc-pascal
, same error. Am 09.03.24 um 16:24 schrieb Luca Olivetti via fpc-pascal: I'm writing a dll that is used by a dot net application (32bits). If I call SerOpen in the initialization section of the dll there is no problem, but if I call it from one of the exported functions it gives me an a

Re: [fpc-pascal] opening a serial port in a dll called from dot net fails

2024-03-10 Thread Luca Olivetti via fpc-pascal
El 9/3/24 a les 16:24, Luca Olivetti via fpc-pascal ha escrit: Never mind, I put the serial port access in a separate exe and the dll communicates with it via an udp socket. I'd still like to know why I got an access denied when trying to open the port from an exported procedure, typic

[fpc-pascal] opening a serial port in a dll called from dot net fails

2024-03-09 Thread Luca Olivetti via fpc-pascal
I'm writing a dll that is used by a dot net application (32bits). If I call SerOpen in the initialization section of the dll there is no problem, but if I call it from one of the exported functions it gives me an access denied (GetLastError gives me a 5), and I really need to call it from a fu

Re: [fpc-pascal] Need some advice

2024-01-24 Thread Luca Olivetti via fpc-pascal
El 24/1/24 a les 20:31, ppadilcdx via fpc-pascal ha escrit: Trying to use the fgl unit, specifically the TFPGMap.   Below is a simple program I'm trying to compile; it gives me two errors: fgl.pp(1582,18) Error: Operator is not overloaded: "pair" < "pair" fgl.pp(1584,23) Error: Operator is not

[fpc-pascal] heaptrc under linux points to the wrong line

2023-08-28 Thread Luca Olivetti via fpc-pascal
Hello, as per the subject, with heaptrc enabled, output to a file and using the "view leaks and traces" feature of lazarus, I see several leaks, always on the same line. However, under linux 64 bits, the line it points to is not where the leak is created. Linux was reporting the leak in this

Re: [fpc-pascal] TSQLQuery doesn't work with a lookup field if it is a memo (text)

2023-01-13 Thread Luca Olivetti via fpc-pascal
El 13/1/23 a les 16:54, Luca Olivetti via fpc-pascal ha escrit: TO solve the issue I just cast the field in the query to a varchar(100), but, FYT, TZQuery (zeos) has no problem with that (but in this project I'm using sqldb). That was meant to be "FYI" :

[fpc-pascal] TSQLQuery doesn't work with a lookup field if it is a memo (text)

2023-01-13 Thread Luca Olivetti via fpc-pascal
Hello, I just found out that if I try to create a lookup field that points to a memo field (in postgresql the field is defined as text), it bombs out with "list index (-2) out of tange" (or a similar message). It seems it is because a TMemo lookup field is assigned -1 as its index. TO solve th

Re: [fpc-pascal] Can't build single package

2022-11-03 Thread Luca Olivetti via fpc-pascal
El 3/11/22 a les 9:31, Tomas Hajny via fpc-pascal ha escrit: Might as well build and install fpc from source :-/ That's always an option, of course. ;-) For the record (and for my memory, since I'm sure I'll forget), I almost did that (i.e. make rtl_install, make packages_install then copie

Re: [fpc-pascal] Can't build single package

2022-11-03 Thread Luca Olivetti via fpc-pascal
El 2/11/22 a les 17:06, Tomas Hajny via fpc-pascal ha escrit: I see. This means that you already have the prerequisites fulfilled in the source tree for Linux, but not for Windows. Start by issuing 'make rtl_all packages_all' in D:\fpc-3.2.2. Then try rebuilding fcl-web in the fcl-web direct

Re: [fpc-pascal] Can't build single package

2022-11-02 Thread Luca Olivetti via fpc-pascal
El 2/11/22 a les 15:54, Tomas Hajny via fpc-pascal ha escrit: OK, the problem is that I installed the compiler with the windows installer and the makefile expects it to be in its tree (hence the "-n" and the "-Fu" options). Is there something I can do (other than building and installing the comp

Re: [fpc-pascal] Can't build single package

2022-11-02 Thread Luca Olivetti via fpc-pascal
El 2/11/22 a les 9:37, Luca Olivetti via fpc-pascal ha escrit: IIRC I did it in the past but now: D:\fpc-3.2.2\packages\fcl-web>make C:/FPC/3.2.2/bin/i386-Win32/ppc386.exe fpmake.pp -n -Fu../../rtl -Fu../../packages/paszlib -Fu../../packages/fcl-process -Fu../../packages/hash

[fpc-pascal] Can't build single package

2022-11-02 Thread Luca Olivetti via fpc-pascal
IIRC I did it in the past but now: D:\fpc-3.2.2\packages\fcl-web>make C:/FPC/3.2.2/bin/i386-Win32/ppc386.exe fpmake.pp -n -Fu../../rtl -Fu../../packages/paszlib -Fu../../packages/fcl-process -Fu../../packages/hash -Fu../../packages/libtar -Fu../../packages/fpmkunit/units_bs/i386-win32 Fatal:

Re: [fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
El 21/10/22 a les 17:09, Luca Olivetti via fpc-pascal ha escrit: El 21/10/22 a les 12:48, Michael Van Canneyt via fpc-pascal ha escrit: I see that Kind is used after the module has been created, so setting it in either method (CreateNew or DataModuleCreate) should be OK, am I right? You are

Re: [fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
El 21/10/22 a les 12:48, Michael Van Canneyt via fpc-pascal ha escrit: I see that Kind is used after the module has been created, so setting it in either method (CreateNew or DataModuleCreate) should be OK, am I right? You are right. I will publish the method. That's an oversight. Meanwhil

Re: [fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
El 21/10/22 a les 9:57, Luca Olivetti via fpc-pascal ha escrit: El 21/10/22 a les 9:48, Luca Olivetti via fpc-pascal ha escrit: El 21/10/22 a les 9:39, Michael Van Canneyt via fpc-pascal ha escrit: And a property of your module:   property Kind: TWebModuleKind read FWebModuleKind write

Re: [fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
El 21/10/22 a les 9:48, Luca Olivetti via fpc-pascal ha escrit: El 21/10/22 a les 9:39, Michael Van Canneyt via fpc-pascal ha escrit: And a property of your module:   property Kind: TWebModuleKind read FWebModuleKind write FWebModuleKind default wkPooled; wkPooled is the default, but if

Re: [fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
El 21/10/22 a les 9:39, Michael Van Canneyt via fpc-pascal ha escrit: And a property of your module:  property Kind: TWebModuleKind read FWebModuleKind write FWebModuleKind default wkPooled; wkPooled is the default, but if you explicitly set this to 'wkPooled' in the constructor, you'll be

[fpc-pascal] Threaded webserver and TJSONRPCModule instances: can I be sure there's only one?

2022-10-21 Thread Luca Olivetti via fpc-pascal
Hello, I'm using a TFPHTTPServerHandler in threaded mode. I'm also using a TJSONRpcModule. I see that, even if the calls come from different threads, only one instance of the rpc module is ever created (on demand, the first time an rpc request comes in) and used. Since I'm relying on this behav

Re: [fpc-pascal] Why TSqlScript has no parameters?

2022-10-10 Thread Luca Olivetti via fpc-pascal
El 10/10/22 a les 19:30, Michael Van Canneyt via fpc-pascal ha escrit: This feature is missing in TSQLScript, because I never needed it, but it should be easy enough to add. No, don't bother, it's just two statements and I can simply use TPQConnection.ExecuteDirect (in fact that's what I'm us

[fpc-pascal] Why TSqlScript has no parameters?

2022-10-10 Thread Luca Olivetti via fpc-pascal
Hello, I need to execute more than one statement. TSqlQuery it seems to accept multiple statements but then it gives a strange error (posgtresql error "no parameter $2", the parameter it refers to is defined and used in the second statement). So I tried a TSQlScript but then I could find no w

Re: [fpc-pascal] JSON RPC changes in 3.3.1

2022-09-28 Thread Luca Olivetti via fpc-pascal
El 28/9/22 a les 8:51, Hairy Pixels via fpc-pascal ha escrit: On Sep 28, 2022, at 1:34 PM, Luca Olivetti via fpc-pascal wrote: Maybe related to this? https://lists.freepascal.org/pipermail/pas2js/2022-September/00.html The question then is did they change something in 3.3.1 in

Re: [fpc-pascal] JSON RPC changes in 3.3.1

2022-09-27 Thread Luca Olivetti via fpc-pascal
El 28/9/22 a les 3:06, Hairy Pixels via fpc-pascal ha escrit: :: <~~ pascal-language-server 6: {'message': 'Parameters must be passed in an object or an array.', 'code': -32602} Maybe related to this? https://lists.freepascal.org/pipermail/pas2js/2022-September/00.html (though I'm getti

Re: [fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Luca Olivetti via fpc-pascal
El 13/9/22 a les 16:28, Michael Van Canneyt via fpc-pascal ha escrit: On Tue, 13 Sep 2022, Luca Olivetti via fpc-pascal wrote: Hello, if I request, e.g. http://localhost:8080 or http://localhost:8080/ fpwebfile returns the document defined as IndexPageName (in my case index.html), but if

[fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Luca Olivetti via fpc-pascal
Hello, if I request, e.g. http://localhost:8080 or http://localhost:8080/ fpwebfile returns the document defined as IndexPageName (in my case index.html), but if I request http://localhost:8080?xxx or http://localhost:8080/?xxx I get a 404. That's because TCustomFileModule.GetRequestFIleNa

Re: [fpc-pascal] TJSONRPCModule: access the request from an handler.

2022-09-09 Thread Luca Olivetti via fpc-pascal
El 9/9/22 a les 15:50, Michael Van Canneyt ha escrit: The solution is much more simple. Override HandleRequest() in the module. Save the request in a variable and call inherited. Much simpler indeed! Thank you. In my case I just save the remote address, but in your example below I suppose yo

Re: [fpc-pascal] Access Violation When SetLength(DynArray, Value)

2022-09-09 Thread Luca Olivetti via fpc-pascal
El 9/9/22 a les 14:58, James Richters via fpc-pascal ha escrit: Is there some nifty way to increase a dynamic array by 1 that is more elegant? Inc(MyArray); would sure be nice If I know that I have to regularly add a single element to an array, instead of using a dynamic array I just use a T

[fpc-pascal] TJSONRPCModule: access the request from an handler.

2022-09-09 Thread Luca Olivetti via fpc-pascal
Hello, I added a "Web JSON-RPC Module" to my project, I dropped on it a TJSONPCHandler. I find no way to access the request (I want to check the RemoteAddress): 1) the module has a "Request" field but it is always nil (either in DataModuleCreate, which isn't called with every request so it's

Re: [fpc-pascal] Access Violation When SetLength(DynArray, Value)

2022-09-09 Thread Luca Olivetti via fpc-pascal
El 8/9/22 a les 16:53, Anthony Walter via fpc-pascal ha escrit: > curious minds want to know: what was the fix? In a separate part of the pool table initialization, I was precalculating the midpoints and normals for bumper rails. I had carelessly written this code:   for I := 0 to Length(R

Re: [fpc-pascal] reading a TFPGMap from several threads

2022-09-07 Thread Luca Olivetti via fpc-pascal
El 7/9/22 a les 14:12, Sven Barth via fpc-pascal ha escrit: Luca Olivetti via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> schrieb am Mi., 7. Sep. 2022, 13:01: Hello, I have a couple of TFPGMaps that I populate once and never change. Is it safe to read them (i.e.

[fpc-pascal] reading a TFPGMap from several threads

2022-09-07 Thread Luca Olivetti via fpc-pascal
Hello, I have a couple of TFPGMaps that I populate once and never change. Is it safe to read them (i.e. use Find and Data[]) from different threads? I'd avoid using a critical section if not absolutely necessary. Bye -- Luca ___ fpc-pascal maillist -

Re: [fpc-pascal] Is there any benefit for a Delphi/Free Pascal/Lazarus programmer to build a C DLL in debug mode ?

2022-08-30 Thread Luca Olivetti via fpc-pascal
El 29/8/22 a les 9:50, Skybuck Flying via fpc-pascal ha escrit: Is there any benefit for a Delphi or Free Pascal/Lazarus programmer to build a C DLL in debug mode ? yes, because I found out that you can debug it right inside lazarus, almost like pascal code. Bye -- Luca _

Re: [fpc-pascal] no array support in sqldb/sqldbrestbridge?

2022-06-08 Thread Luca Olivetti via fpc-pascal
El 7/6/22 a les 14:15, LacaK via fpc-pascal ha escrit: Hi, So, is there no array field support in sqldb and/or in sqldbrestbridge? there was added into DB.pas : TObjectField and TArrayField https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-db/src/base/db.pas but impleme

[fpc-pascal] no array support in sqldb/sqldbrestbridge?

2022-06-07 Thread Luca Olivetti via fpc-pascal
llo, since I'm going to need arrays in a postgresql database to expose via a rest api, I did a simple test with sqldbrestbridge. I created a simple table: create table prueba (x integer not null, y integer[]); insert into prueba values (1, '{2,3}'); then I exposed it with sqlrestdb: FDisp

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 18:37, Dennis Lee Bieber via fpc-pascal ha escrit: Detection is normally done by: if current tick is less than saved tick, roll-over has occurred. Make adjustments to the delta. There is no need to do that, just make sure you're using DWORDs (i.e. unsigned arithmetic)

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 16:41, Travis Siegel via fpc-pascal ha escrit: If there's some sort of a configuration file, just write out the time/date info at the time of leaving the input, then when that routine gets called again, grab the current time/date, and perform a comparison.  That should allow yo

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 14:52, James Richters via fpc-pascal ha escrit: I'm trying to get the time lapsed since the last user input with keyboard or mouse on a Windows PC. For this I am doing: GetLastInputInfo(Last_Input_Info); IdleTime:= (GetTickCount - Last_Input_Info.dwTime) DIV 1000; I was going

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Luca Olivetti via fpc-pascal
El 10/9/21 a les 10:21, Michael Van Canneyt via fpc-pascal ha escrit: https://gitlab.com/dashboard/issues?scope=all&state=all&author_username=olivluca This one works though https://gitlab.com/dashboard/issues?scope=all&state=all&search=%40olivluca I see you are referenced in many issues

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Luca Olivetti via fpc-pascal
El 10/9/21 a les 9:39, Luca Olivetti via fpc-pascal ha escrit: El 10/9/21 a les 8:12, Michael Van Canneyt via fpc-pascal ha escrit: Then it means the FPC issues  should appear in your gitlab todo list. I don't know if is there something wrong or I just don't know how to use gitlab

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Luca Olivetti via fpc-pascal
El 10/9/21 a les 8:12, Michael Van Canneyt via fpc-pascal ha escrit: Then it means the FPC issues  should appear in your gitlab todo list. I don't know if is there something wrong or I just don't know how to use gitlab: I have reported some bugs, e.g. https://gitlab.com/freepascal.org/fpc

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-12 Thread Luca Olivetti via fpc-pascal
El 12/8/21 a les 9:59, Martin Frb via fpc-pascal ha escrit: If you have size restrictions, and can't do a full clone, you need a special translation (which you have to find, somewhere in a large manual). https://xkcd.com/1597/ SCNR ;-) (OTOH that could be said also for svn, mercurial, etc.

Re: [fpc-pascal] How to check if a network is available?

2021-06-21 Thread Luca Olivetti via fpc-pascal
El 20/6/21 a les 19:38, Jean SUZINEAU via fpc-pascal ha escrit: Ping uses ICMP protocol. I don't have currently Indy installed on my machines, but I think you can find pascal components for ICMP client and even ICMP server. I think that this way you can do a single "ping", a single ICMP request

Re: [fpc-pascal] Dependency of OpenSSL 1.0.2 still in FPC 3.2.0 on some platforms?

2021-06-06 Thread Luca Olivetti via fpc-pascal
El 6/6/21 a les 8:58, gebylist via fpc-pascal ha escrit: Just place Synapse's sources somewhere, where your project "see it". That's what a lazarus' package does. Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists

Re: [fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-12 Thread Luca Olivetti via fpc-pascal
El 12/1/21 a les 10:24, Michael Van Canneyt via fpc-pascal ha escrit: Am I right thinking that, even if several copies of the above method are running, each will get it's own local variables, so the LocCommandQueue variable (as well as the other locals) won't be clobbered by another copy? O

Re: [fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-12 Thread Luca Olivetti via fpc-pascal
El 8/1/21 a les 11:14, Luca Olivetti via fpc-pascal ha escrit: El 8/1/21 a les 11:06, Michael Van Canneyt via fpc-pascal ha escrit: Are you using https ? No, plain text http. An even weirder fact is that I seem to get the wrong ip address (i.e. the address of a different client). I think

Re: [fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-08 Thread Luca Olivetti via fpc-pascal
El 8/1/21 a les 11:06, Michael Van Canneyt via fpc-pascal ha escrit: Are you using https ? No, plain text http. An even weirder fact is that I seem to get the wrong ip address (i.e. the address of a different client). Bye -- Luca ___ fpc-pascal m

Re: [fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-08 Thread Luca Olivetti via fpc-pascal
El 7/1/21 a les 16:59, Luca Olivetti via fpc-pascal ha escrit: El 7/1/21 a les 16:15, Luca Olivetti via fpc-pascal ha escrit: Hello, I need to tailor the content based on the remote ip address. I use the property RemoteAddr of a TRequest, but sometimes it is empty. I see that it is a header

Re: [fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-07 Thread Luca Olivetti via fpc-pascal
El 7/1/21 a les 16:15, Luca Olivetti via fpc-pascal ha escrit: Hello, I need to tailor the content based on the remote ip address. I use the property RemoteAddr of a TRequest, but sometimes it is empty. I see that it is a header, what I didn't see (yet, I'll trace through the code la

[fpc-pascal] fcl-web: Trequest.RemoteAddr is empty (sometimes)

2021-01-07 Thread Luca Olivetti via fpc-pascal
Hello, I need to tailor the content based on the remote ip address. I use the property RemoteAddr of a TRequest, but sometimes it is empty. I see that it is a header, what I didn't see (yet, I'll trace through the code later) is if it is sent from the remote host or is it filled based on the ip

Re: [fpc-pascal] callback from c with varargs

2020-12-20 Thread Luca Olivetti via fpc-pascal
El 20/12/20 a les 14:00, Jonas Maebe via fpc-pascal ha escrit: On 20/12/2020 13:01, Luca Olivetti via fpc-pascal wrote: El 19/12/20 a les 23:15, Jonas Maebe via fpc-pascal ha escrit: It is indeed not possible to implement a function with C varargs in FPC. I was afraid that's the a

Re: [fpc-pascal] Selecting Records with a variable

2020-12-20 Thread Luca Olivetti via fpc-pascal
El 20/12/20 a les 16:02, James Richters via fpc-pascal ha escrit: What I’m hopping to accomplish isn't to get it to work... it's to consolidate a whole bunch of functions and procedures that are all exactly the same except for which axis I am working with... I have 9 possible Axis, X,Y,Z,W,L.R

Re: [fpc-pascal] callback from c with varargs

2020-12-20 Thread Luca Olivetti via fpc-pascal
El 19/12/20 a les 23:15, Jonas Maebe via fpc-pascal ha escrit: On 19/12/2020 22:35, Luca Olivetti via fpc-pascal wrote: I'm trying to use a c library where I can define a logging plugin. The c prototype for the callback is     void (*log)(void *logContext, UA_LogLevel level, UA_LogCat

[fpc-pascal] callback from c with varargs

2020-12-19 Thread Luca Olivetti via fpc-pascal
Hello, I'm trying to use a c library where I can define a logging plugin. The c prototype for the callback is void (*log)(void *logContext, UA_LogLevel level, UA_LogCategory category, const char *msg, va_list args); however I couldn't find a way to define a suitable callback in fpc sinc

Re: [fpc-pascal] Initialization of constant record member of pointer type

2020-12-14 Thread Luca Olivetti via fpc-pascal
El 1/12/20 a les 11:00, LacaK via fpc-pascal ha escrit: Thank you, yes it works. I have used: const   MyConst1: AnsiString = 'abc'   MyConst2: TMyRec = (a: @MyConst1[1]); It doesn't compile with fpc 3.2.0 (I'm trying, without success so far, your open62541 translation). In order to comp

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Luca Olivetti via fpc-pascal
El 2/12/20 a les 13:30, Michael Van Canneyt via fpc-pascal ha escrit: On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote: But the 'current translation' is simply the value of the resourcestring, so you should not need to look it up ? How? I'm trying to detect this spe

Re: [fpc-pascal] How to get the current translation of a resource string?

2020-12-02 Thread Luca Olivetti via fpc-pascal
El 2/12/20 a les 11:49, Michael Van Canneyt via fpc-pascal ha escrit: On Tue, 1 Dec 2020, Luca Olivetti via fpc-pascal wrote: Since I want to treat a specific exception that cannot be distinguished by the class alone but only by the class and message, I need to find the current translation

[fpc-pascal] How to get the current translation of a resource string?

2020-12-01 Thread Luca Olivetti via fpc-pascal
Since I want to treat a specific exception that cannot be distinguished by the class alone but only by the class and message, I need to find the current translation of the resource string used to create the exception. The documentation at https://www.freepascal.org/docs-html/current/prog/progs

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-06 Thread Luca Olivetti via fpc-pascal
El 6/10/20 a les 9:01, Michael Van Canneyt via fpc-pascal ha escrit: A simple filecreate, allocate buffer, fileread, fileclose will probably be easiest. Lazarus has a ReadFileToString in fileutil. Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@

Re: [fpc-pascal] stdcall without the ;

2020-09-24 Thread Luca Olivetti via fpc-pascal
El 23/9/20 a les 19:45, Luca Olivetti via fpc-pascal ha escrit: El 23/9/20 a les 17:38, Santiago A. via fpc-pascal ha escrit: El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió: Hello, I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, while it works here, it

Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
El 23/9/20 a les 17:38, Santiago A. via fpc-pascal ha escrit: El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió: Hello, I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, while it works here, it fails when the customer runs it. What does "it fails"

[fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
Nevermind, I checked with -s -a and the generated assembler is the same, with or without the ';' Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
I did more than that, I created a DLL that simulates the hardware (it's a phidget I/O board) and it works perfectly, both with the old and the new executable. Thank you for the idea. Bye -- Luca 23 sept. 2020 15:33:05 Michael Van Canneyt : > On Wed, 23 Sep 2020, Luca Olivetti via fp

Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
But I don't have the hardware managed by the DLL so the callbacks are never called here. Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
Hello, I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, while it works here, it fails when the customer runs it. I noticed that I'm using a dll and the functions and callbacks are declared stdcall (the platform is win32) but without the ;, i.e.: function OnAttach(handle: p

Re: [fpc-pascal] ExecuteProcess problem

2020-08-25 Thread Luca Olivetti via fpc-pascal
El 25/8/20 a les 14:31, Koenraad Lelong via fpc-pascal ha escrit: Hi, I'm extending an old daemon so it writes the data to MQTT, using mosquitto_pub. Not what you're asking, but did you try to send the messages yourself instead of using mosquitto_pub? I didn't try it, but there's https://gi