[Lazarus] dbgrid with a lookup field
please see https://docs.google.com/document/d/1RprJLM1i7dgJvfz-lDryH-Jc9I8xVv8gvzsKeYoI6Ps/edit?usp=sharing I have a DBGrid with a lookup colum, say column 0. The user selects a row in the picklist and the focus goes to the undelying lookup cell (0), what makes sense. However I'd like the focus set to cell with index 2 in the row. How do I do that? Which event is fired when the user makes a selection in a lookup column? Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] question re tdblookupcombobox
the string to display on screen (property DataField) is short. The strings that are listed for selection (field ListField) are wide. I would like to have the control width = 66 pixels and the drop-down list width = 200 pixels. Is there a way to get this behaviour? Right now, the drop-down list is 66 pixels and as a result the strings in the list are truncated...very ugly. Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] vertically space controls
that's it! On Sun, Apr 28, 2024 at 7:09 PM Werner Pamler via lazarus < lazarus@lists.lazarus-ide.org> wrote: > Am 28.04.2024 um 18:56 schrieb duilio foschi via lazarus: > > I select N controls in a form. > > > > C1 is the top control. C6 is the lowest control. > > > > I want controls C1..C6 be equally spaced in the vertical space given > > by C1.Top and C6.Top. > > > > In Delphi 5 IDE I had the Alignment Palette by which I could do that > > (and other useful operations). > > > > I cannot find the same tool in Lazarus v. 2.2.4. > > > > Is there such a tool? > Select the controls. Right-click one of them. --> "Align" --> In the > "vertical" box select "Space equally". > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] vertically space controls
I select N controls in a form. C1 is the top control. C6 is the lowest control. I want controls C1..C6 be equally spaced in the vertical space given by C1.Top and C6.Top. In Delphi 5 IDE I had the Alignment Palette by which I could do that (and other useful operations). I cannot find the same tool in Lazarus v. 2.2.4. Is there such a tool? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] italian accented vowels wrongly displayed in a TMemo
byte F9 is correctly displayed as ù (accented u) in PSPad/Hex (see https://ibb.co/S7Z6rx5) and wrongly displayed as ? in my TMemo (see https://ibb.co/BBTRhPy). Any help? What do I do wrong? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] open source warehouse program: any hint?
I am looking for a simple program as explained in the subject.. It should be in Pascal, Delphi or Lazarus. Any hint? Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] html server doubts
I wrote a BE server expanding the TTestHTTPServer I found in the samples. Each inbound call is handled by (common) code that sets a number of global variables like sessionID, url, method etc. Then the call call goes thru the Match function of several specialized components. When the Match function of component X returns TRUE, this component is the one that does the rest of processing:, i.e. read the incoming payload (in case of a POST), read the inline parameters (in case of a GET), query the DB, write a result etc Now I wonder if this working is safe for a server that handles multiple calls. I mean: the inbound calls are produced by visitors of a website. Say a call produced by visitor A comes in at time T1 and immediately after it (at time T2) a call produced by visitor B reaches the server, the global variables will be rewritten possibly before the first processing is completed, what could cause havoc. Shouldn't the memory used for each call be different? Shouldn't I use threads? Or - due to some magics of class TFPHTTPServer - is the memory _already_ different at each new call? I hope I did not say something too stupid... Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] questioning ARequest: TFPHTTPConnectionRequest :)
It belongs to TFPHTTPConnectionRequest's grandfather (ancestor of ancestor). Silly of me, I had gone back only one generation! :) Thank you Peppe On Mon, Feb 27, 2023 at 8:23 AM Michael Van Canneyt via lazarus wrote: > > > > On Sun, 26 Feb 2023, duilio foschi via lazarus wrote: > > > my simple BE server uses this function to handle all inbound calls: > > > > procedure TTestHTTPServer.HandleRequest( > > var ARequest: TFPHTTPConnectionRequest; > > var AResponse: TFPHTTPConnectionResponse > > ); > > > > When the call is a POST, I want to read the json payload inside ARequest. > > > > I expected to find a property like Body:string inside > > TFPHTTPConnectionRequest, but I could not find it. > > The property is called Content. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] questioning ARequest: TFPHTTPConnectionRequest :)
my simple BE server uses this function to handle all inbound calls: procedure TTestHTTPServer.HandleRequest( var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse ); When the call is a POST, I want to read the json payload inside ARequest. I expected to find a property like Body:string inside TFPHTTPConnectionRequest, but I could not find it. How do I get the the json payload which is inside ARequest? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] TFPHTTPServer
that was it. Thanks a lot Peppe On Thu, Feb 23, 2023 at 11:07 AM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 23 Feb 2023, duilio foschi via lazarus wrote: > > > I wrote a simple server using TFPHTTPServer. > > > > All incoming calls are processed using > > procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; > > var AResponse: TFPHTTPConnectionResponse); > > > > My first tests were ok and encouraging but... how do I know if the > > call was a GET or a POST? > > > > I guess that ARequest "knows" it, but I cannot find a way to ask :) > > Try ARequest.Method, this is the HTTP method string as sent by the client. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] TFPHTTPServer
I wrote a simple server using TFPHTTPServer. All incoming calls are processed using procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse); My first tests were ok and encouraging but... how do I know if the call was a GET or a POST? I guess that ARequest "knows" it, but I cannot find a way to ask :) Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] vanishing main menu wanted
these images show what I have now: 1. https://ibb.co/CwKYdvv the main menu is attached to the form (standard behavior) 2. https://ibb.co/wghVxrp when I switch from Tab1 to Tab2, the main menu stays visible These images show what I would like: 3. https://ibb.co/TmDdcRB the menu is attached to Tab1 4. https://ibb.co/ngL5jnt when I switch from Tab1 to Tab2, the menu disappears Which is the best way to get this effect? Maybe a TFlowPanel with a number of TEdit controls inside? Maybe a simple TStringgrid? Any suggestion? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] revamping a very old print
I would like to give a new life to a very old application that was written in foxplus (a xbase dialect) in 1990 :) At that time, the display was 80 char per line and the printer was 132 char per line, so data was printed using the logics you will find at the bottom of this message. I wonder if I can still use the old code somehow. My idea is: 1. I get the printer PageWidth in pixel PageWidth:=Printer.PageWidth; 2. I get the printer PageHeight in pixel PageHeight:=Printer.PageHeight; 3. I get the height of a line LineHeight:=Printer.Canvas.TextHeight('M')+5; // I add a few pixels to prevent text lines to overlap; 4. I get the number of rows in a page MaxLinesNo:=PageHeight div LineHeight 5. now lets translate line @7,87 SAY "CITTA'PARTITA IVA" "7" --> translates into yPos:=LineHeight*7 "87" --> translates into xPos:= round (87/132*PageWidth); so I write Printer.Canvas.Textout(XPos, YPos, 'CITTA'PARTITA IVA'); 6. how do I set the size of the font? I am expecting not less than 56 lines in a page, so I shrink the font size until I get LineHeight <=Printer.PageHeight div 60 7. I am surely missing something. Any help? Thank you Peppe SET DEVI TO PRIN EJECT GO TOP TIT=.T. DO WHIL .NOT. EOF() * if current row >=max, jump to the new page and print header IF PROW()>=56 TIT=.T. EJECT ENDI IF TIT * print header @1,2 SAY "___" @1,57 SAY "___" @1,112 SAY "" @2,1 SAY "|" @2,132 SAY "|" @3,1 SAY "| "+AZIENDA IF TA="C" @3,58 SAY "LISTATO CLIENTI ALLA DATA ; "+DTOC(DATE()) ELSE @3,58 SAY "LISTATO FORNITORI ALLA DATA ; "+DTOC(DATE()) ENDI @3,132 SAY "|" @4,1 SAY "|" @4,132 SAY "|" @5,1 SAY "|__" @5,56 SAY "___" @5,111 SAY "_|" @7,2 SAY "CODICERAGIONE SOCIALE SEDE ; LEG." @7,87 SAY "CITTA'PARTITA IVA" @8,79 TIT=.F. ENDI * end print header @PROW()+1,1 SAY SUBS(COD_CL,1,2)+"."+SUBS(COD_CL,3,2)+"."+SUBS(COD_CL,; 5,5) @PROW(),16 SAY DES_CL @PROW(),48 SAY SEDE_LEG @PROW(),80 SAY CAP_CITTA @PROW(),112 SAY PART_IVA SKIP ENDD @PROW()+1,1 SAY " " SET DEVI TO SCRE RETU -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
>we switched to using datatables.net very interesting. Is any sample code available for its use with pas2js? . Thank you Peppe On Wed, Nov 9, 2022 at 1:08 PM Michael Van Canneyt via lazarus wrote: > > > > On Tue, 8 Nov 2022, duilio foschi wrote: > > > I am puzzled by TMS Software. > > You are not alone. Your story is recognizable. > > [snip] > > > I bought TMS Web Core months ago with the idea of quickly write web > > applications in Lazarus, with a special aim at their > > TWebGridComponent, but I can say today that it was no wise purchase :) > > What can I say ? > > We cooperated with them, we have made pas2js available to them, > we provide quick bugfixes and improvements of pas2js, > but we have no control over what they do with it or how their helpdesk > functions. > > As for the grid component: > In my daily work development environment we switched to using datatables.net. > I can recommend it, just as bootstrap-table. It has all you need. > > It's perfectly usable with pas2js and the import units are available with > pas2js. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
I am puzzled by TMS Software. 1. there is one demo specific for SQLDBRestBridge, but the application is obviously bugged, as you see from the following screenshot https://i.ibb.co/m4wVGtM/2.jpg as a start, the code for the login and logout button is the same, what cannot be 2. the support will deny even under torture the idea that TMS code can have bugs. The fault is always yours. You did not read the manual carefully (666 pages) or did not study CORS carefully or have knowledge gaps. All true in my case... but I can see a bug when I meet one :) 3. in the end, they will suggest you buy their bridge solution, called XData, as they cannot waste their time with a bridge server they did not write (verbatim) :) Probably (I reckon) they are not very interested in the Lazarus market, as they gain most income from the Delphi market. As a matter of fact, I find their support not helpful at all. They dont help you to solve your problem: they will deny that a problem exists or will pretend that you will be able to solve your problem after a few months' study of technical documentation :) I bought TMS Web Core months ago with the idea of quickly write web applications in Lazarus, with a special aim at their TWebGridComponent, but I can say today that it was no wise purchase :) Thank you Peppe On Tue, Nov 8, 2022 at 7:56 AM Michael Van Canneyt via lazarus wrote: > > > > On Mon, 7 Nov 2022, duilio foschi wrote: > > > I fixed the code in Lazarus and got a client based on BufDataClient > > that successfully talks with a restbridge server. > > > > As a next step, I'd like to connect to the same server from a TWebForm > > of TMS Web Core library. > > Normally, TMS Web Core contains a dataset component that handles SQLDBRest > connections?. > > I wrote it myself for them. > > > > > I started with a slow step. There is only a TWebHttpRequest in the > > form (which has the same functions of a TFPHTTPClient) and it issues a > > GET to URL > > http://localhost:3000/metadata/?fmt=json=0 > > > > This command works ok in the windows client. > > > > Here, I get the errors shown in pic > > https://i.ibb.co/dpsjfQQ/1.jpg > > > > The message (a CORS error) is attached below. > > Aaaahhh... Welcome to CORS hell... :/ > > > > > Weird enough, the message is there even after changing the server code > > in this way: > > > > original code: > > > > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS]; > > > > new code > >FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView]; > > This is the exact opposite of what you should do. > > The rdoHandleCORS option must be there, or CORS will not be handled at all. > > > > > Is there a way to tell the server to ignore CORS errors? > > > > The CORS errors are from the browser, not from the server. > > > > Or there a way to sweet-talk the server to accept the requests from a > > TMS Web form? :) > > Yes, you must add localhost as an allowed origin in CORSAllowedOrigins. > > FDisp.CORSAllowedOrigins:='localhost:3000' > > If you are not using authentication, as an alternative, you can try > FDisp.CORSAllowedOrigins:='*' > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
I fixed the code in Lazarus and got a client based on BufDataClient that successfully talks with a restbridge server. As a next step, I'd like to connect to the same server from a TWebForm of TMS Web Core library. I started with a slow step. There is only a TWebHttpRequest in the form (which has the same functions of a TFPHTTPClient) and it issues a GET to URL http://localhost:3000/metadata/?fmt=json=0 This command works ok in the windows client. Here, I get the errors shown in pic https://i.ibb.co/dpsjfQQ/1.jpg The message (a CORS error) is attached below. Weird enough, the message is there even after changing the server code in this way: original code: FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS]; new code FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView]; Is there a way to tell the server to ignore CORS errors? Or there a way to sweet-talk the server to accept the requests from a TMS Web form? :) Thank you Peppe project1.html:1 Access to XMLHttpRequest at 'http://localhost:3000/metadata/?fmt=json=0' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. project1.js:263 Uncaught {fMessage: 'HTTP request error @http://localhost:3000/metadata/?fmt=json=0'} cb @ project1.js:263 error (async) Execute$2 @ project1.js:12331 Execute @ project1.js:12316 btnClick @ project1.js:12649 cb @ project1.js:241 Click @ project1.js:6631 HandleDoClick @ project1.js:6120 cb @ project1.js:241 project1.js:12356 GET http://localhost:3000/metadata/?fmt=json=0 net::ERR_FAILED Execute$2 @ project1.js:12356 Execute @ project1.js:12316 btnClick @ project1.js:12649 cb @ project1.js:241 Click @ project1.js:6631 HandleDoClick @ project1.js:6120 cb @ project1.js:241 On Sun, Nov 6, 2022 at 11:27 PM Michael Van Canneyt via lazarus wrote: > > > > On Sun, 6 Nov 2022, duilio foschi wrote: > > > Hi Michael, > > > > I am digging into your SQLDBRestBridge component. Very useful code. > > > > I could fix and run both the server part and the client part (I used > > the BufDataset client). > > > > My code (with very few changes applied to the original one) can be > > downloaded from this link: > > https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ > > > > I hope it be helpful for somebody. > > > > > > > > I have 2 questions: > > > > 1. the client needs to know the name of the primary key (PK) of each > > table. Is there a way to ask the server for the name of the PK of > > table A? Or to have the PK listed in the metadata? > > Normally the server has this info, and the primary key is retrieved when > exposing a database. It is part of fieldinfo, but not yet exposed in the > metadata, I think. I will add it, this is easy to do. > > > 2. the client needs to periodically refresh the visible rows in the > > event that another client applied changes to the DB. How is this done? > > I reckon that the client will remember the last command > > like > > BASEURL/resourcename?limit=10=50 > > and reissue it. Right? > > Yes, but you need to program this yourself. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
Hi Michael, I am digging into your SQLDBRestBridge component. Very useful code. I could fix and run both the server part and the client part (I used the BufDataset client). My code (with very few changes applied to the original one) can be downloaded from this link: https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ I hope it be helpful for somebody. I have 2 questions: 1. the client needs to know the name of the primary key (PK) of each table. Is there a way to ask the server for the name of the PK of table A? Or to have the PK listed in the metadata? 2. the client needs to periodically refresh the visible rows in the event that another client applied changes to the DB. How is this done? I reckon that the client will remember the last command like BASEURL/resourcename?limit=10=50 and reissue it. Right? Thank you Peppe On Fri, Nov 4, 2022 at 9:05 AM Michael Van Canneyt wrote: > > > > On Thu, 3 Nov 2022, duilio foschi wrote: > > >> Please look at the intercept example > > > > could you please expand on this? > > In the http request router, you can register global handlers which are > executed > for every request. You can choose if the handler is executed before or after > the normal handler for the request. > > > > > > Where do I find the intercept example? > > https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-web/examples/intercept/simpleserver.pas > > This example shows both kind of handlers, before and after request. The > before request handler just logs the URL, just what you need. > > Michael. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
>Please look at the intercept example could you please expand on this? Where do I find the intercept example? Thank you Peppe On Thu, Nov 3, 2022 at 11:17 PM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 3 Nov 2022, duilio foschi wrote: > > > Hi Michael, > > > > I was able to log the info shown in this pic > > https://i.ibb.co/f4MJQFJ/1.jpg > > > > (I used a rough writeln for now). > > > > This is fine when you want to verify the behaviour of the application > > itself. > > > > 1. > > == > > Is there a way to have the server log HTTP commands received from the > > client? > > > > Like: > > http://localhost:3000/EXPENSES?fmt=buf=1 > > Yes. > > Please look at the intercept example. You can register an interceptor (a kind > of middleware) and log all URLs. > > > > 2. > > == > > Is there a way to have the server log the data returned to the client? > > > > This data will be very valuable when trying to debug a client > > developed by 3th parties that misbehave (what is my condition now). > > > > The alternative will be to use a HTTP proxy. > > Same here: you can register an interceptor for this, use the iaAfter to > indicate that the interceptor takes place after the request was handled. > > The content should still be available in the response.content or > response.contentstream. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] SQLDBRestBridge
Hi Michael, I was able to log the info shown in this pic https://i.ibb.co/f4MJQFJ/1.jpg (I used a rough writeln for now). This is fine when you want to verify the behaviour of the application itself. 1. == Is there a way to have the server log HTTP commands received from the client? Like: http://localhost:3000/EXPENSES?fmt=buf=1 2. == Is there a way to have the server log the data returned to the client? This data will be very valuable when trying to debug a client developed by 3th parties that misbehave (what is my condition now). The alternative will be to use a HTTP proxy. Thank you Peppe On Thu, Nov 3, 2022 at 10:10 AM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 3 Nov 2022, duilio foschi via lazarus wrote: > > > I could get client and server talk each other. > > > > For the future, it would be nice to have the server (when in debug > > mode) write a log of commands and data exchanged with the client. > > This exists already. TRestDispatcherLogOption gives you this. > > In fact, there are 2 properties: > > // Logging options > Property LogOptions : TRestDispatcherLogOptions Read FLogOptions write > FLogOptions default DefaultDispatcherLogOptions; > // SQL Log options. Only for connections managed by RestDispatcher > Property LogSQLOptions : TDBEventTypes Read FDBLogOptions write > FDBLogOptions default DefaultLogSQLOptions; > > And add a OnLog event handler. > > If you think some extra option is needed, let me know and I will see what I > can do. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] SQLDBRestBridge
I could get client and server talk each other. For the future, it would be nice to have the server (when in debug mode) write a log of commands and data exchanged with the client. Both inbound and outbound commands/data are needed. I have a hard time figuring out where to insert my code. Any help? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] jedi code formatter
I could edit file jcfsettings.cfg and get most of the wanted features. There are 2 more features I'd like to get, but I cannot understand how: https://i.ibb.co/YkJ1Txm/1.jpg Any help? Btw: is there any manual available? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] testing demorestbridge without a web server: is that possible?
Dear Zeljko, >If this results in error 400-40xx this is exactly what happens :) c:\>curl -u Detlef:secret -H "Content-Type: application/json" "http://localhost:3000/REST/metadata; { "error" : { "code" : 404, "message" : "NOT FOUND" } } >then you must include connection after REST eg http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata gulp! Which is my default connection name? Thank you Peppe On Thu, Oct 27, 2022 at 7:13 PM zeljko wrote: > > > > On 27. 10. 2022. 19:03, duilio foschi via lazarus wrote: > > I tried to run demorestbridge inside Lazarus in debug mode. > > > > When the web browser points to > > http://localhost:3000/REST/metadata > > > > the debugger shows an error message that says: > > > > 'project SQLDB REST bridge raised an exception of class 'EHTTP' with > > message: No REQUEST_METHOD passed from server.. At address 10009D512' > > > > Any idea what this could mean? > > Yes, browsers by default do not send requested params (eg. request > method). Use curl to test your server. > eg > > curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json" > "http://localhost:3000/REST/metadata; > > curl by default set request method to GET. > curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json" -X > GET "http://localhost:3000/REST/metadata; > > If this results in error 400-40xx then you must include connection after > REST eg http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata > > zeljko -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] testing demorestbridge without a web server: is that possible?
I tried to run demorestbridge inside Lazarus in debug mode. When the web browser points to http://localhost:3000/REST/metadata the debugger shows an error message that says: 'project SQLDB REST bridge raised an exception of class 'EHTTP' with message: No REQUEST_METHOD passed from server.. At address 10009D512' Any idea what this could mean? Thank you Peppe On Wed, Oct 26, 2022 at 10:54 PM duilio foschi wrote: > > >> > You can test this by typing the following in a browser address bar: > > http://localhost:3000/REST/metadata > and you should get the metadata from the REST service. > << > > I tried this but I dont get the metadata as expected. > > Instead, the browser displays the following message in json format > > { > "error" : { > "code" : 404, > "message" : "NOT FOUND" > } > } > > > >> > (you may need to provide the username and password you configured in the > rest bridge) > << > > could you please expand on this? How do I provide username/password > from the browser? > > When we talk about username/password do we mean one of the rows of table > USERS? > > I run bufclient but the answer is always the same: 404 NOT FOUND > > What am I missing? > > Thank you > > Peppe > > On Wed, Oct 26, 2022 at 8:52 AM Michael Van Canneyt via lazarus > wrote: > > > > > > > > On Tue, 25 Oct 2022, duilio foschi via lazarus wrote: > > > > > following the suggestions offered by zeljiko (thank you, zeljko), I > > > was able to compile and successfully run > > > demorestbridge.exe > > > > > > Albeit no message is displayed when the EXE starts, I can see that the > > > application is alive and answering requests at port 3000 (I use > > > command >netstat -bano for this). > > > > > > The next step I'd like to reach is to run a client demo that will > > > communicate with the server above. > > > > > > Demo bufclient compiles successfully > > > > > > At start time, I need to insert data into 3 boxes: > > > > > > 1. URL > > > 2. username > > > 3. password > > > > > > #2 and #3 are no problem, of course. > > > > > > #1 puzzles me. > > > > > > The box has the following string preset > > > http://localhost:3000/ > > > > > > To my poor knwoledge, http requires a web server and I have no web > > > server running in my PC with windows 7. > > > > > > Is there any way to do a quick test of demorestbridge.exe without > > > installing a web server? > > > > You don't need a webserver if you are using the demorestbridge. > > > > demorestbridge.exe itself acts as a webserver, it listens on port 3000. > > > > You can test this by typing the following in a browser address bar: > > > > http://localhost:3000/REST/metadata > > > > and you should get the metadata from the REST service. > > (you may need to provide the username and password you configured in the > > rest bridge) > > > > If that works, then in the bufclient demo, enter the URL > > > > http://localhost:3000/REST/ > > > > And push 'Get resource list' button to see a list of resources. > > > > Michael. > > -- > > ___ > > lazarus mailing list > > lazarus@lists.lazarus-ide.org > > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] testing demorestbridge without a web server: is that possible?
>> You can test this by typing the following in a browser address bar: http://localhost:3000/REST/metadata and you should get the metadata from the REST service. << I tried this but I dont get the metadata as expected. Instead, the browser displays the following message in json format { "error" : { "code" : 404, "message" : "NOT FOUND" } } >> (you may need to provide the username and password you configured in the rest bridge) << could you please expand on this? How do I provide username/password from the browser? When we talk about username/password do we mean one of the rows of table USERS? I run bufclient but the answer is always the same: 404 NOT FOUND What am I missing? Thank you Peppe On Wed, Oct 26, 2022 at 8:52 AM Michael Van Canneyt via lazarus wrote: > > > > On Tue, 25 Oct 2022, duilio foschi via lazarus wrote: > > > following the suggestions offered by zeljiko (thank you, zeljko), I > > was able to compile and successfully run > > demorestbridge.exe > > > > Albeit no message is displayed when the EXE starts, I can see that the > > application is alive and answering requests at port 3000 (I use > > command >netstat -bano for this). > > > > The next step I'd like to reach is to run a client demo that will > > communicate with the server above. > > > > Demo bufclient compiles successfully > > > > At start time, I need to insert data into 3 boxes: > > > > 1. URL > > 2. username > > 3. password > > > > #2 and #3 are no problem, of course. > > > > #1 puzzles me. > > > > The box has the following string preset > > http://localhost:3000/ > > > > To my poor knwoledge, http requires a web server and I have no web > > server running in my PC with windows 7. > > > > Is there any way to do a quick test of demorestbridge.exe without > > installing a web server? > > You don't need a webserver if you are using the demorestbridge. > > demorestbridge.exe itself acts as a webserver, it listens on port 3000. > > You can test this by typing the following in a browser address bar: > > http://localhost:3000/REST/metadata > > and you should get the metadata from the REST service. > (you may need to provide the username and password you configured in the > rest bridge) > > If that works, then in the bufclient demo, enter the URL > > http://localhost:3000/REST/ > > And push 'Get resource list' button to see a list of resources. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] testing demorestbridge without a web server: is that possible?
following the suggestions offered by zeljiko (thank you, zeljko), I was able to compile and successfully run demorestbridge.exe Albeit no message is displayed when the EXE starts, I can see that the application is alive and answering requests at port 3000 (I use command >netstat -bano for this). The next step I'd like to reach is to run a client demo that will communicate with the server above. Demo bufclient compiles successfully At start time, I need to insert data into 3 boxes: 1. URL 2. username 3. password #2 and #3 are no problem, of course. #1 puzzles me. The box has the following string preset http://localhost:3000/ To my poor knwoledge, http requires a web server and I have no web server running in my PC with windows 7. Is there any way to do a quick test of demorestbridge.exe without installing a web server? Probably a stupid question... Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] demorestbridge
I am trying to use the demo that I find in directory C:\lazarus\fpc\3.2.2\source\packages\fcl-web\examples\restbridge Following the instructions in file readme.txt, 1. I created a firebird database (test.fdb) 2. I run expenses-fb.sql to create the db structure 3. I run expenses-data.sql to insert some data in the tables Now I read: << You must edit the program to provide the correct database credentials: look for the ExposeDatabase() call, and edit the username/password. You must also change the name and location of the database >> so I changed the original line FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','expensetracker','You','YourSecret',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]); into FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','c:\\test.fdb','sysadm','masterkey',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]); (where the database path is of course C:\lazarus\fpc\3.2.2\source\packages\fcl-web\examples\restbridge\test.fdb ) However when I compile and run the demo, I get the following error message: "Can not load PostgreSQL client library "libpq.dll". Check your installation" I noticed that a library of name libpq.dll is inside the demo directory. This library was 32 bits, but I compile the demo at 64bits. I downloaded the 64bit library but still no joy (same error). A solution is suggested here https://forum.lazarus.freepascal.org/index.php?topic=43476.0 with several DLLs copied into the working directory but... who wants Postgres? I only work with Firebird. How do I change the code so that only Firebird databases are handled (and no Postgres DLL is needed)? Also: how does the bridge know about the database type one wants to use? I could find no explanation re this question in pages https://wiki.freepascal.org/SQLDBRestBridge Any help? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] fish application as web application
> There seems to be an alternate version at: unfortunately no sort of dbgrid is used, which would make the application much more interesting. How is a web dbgrid created in Lazarus? Is any example available? Thank you Peppe On Thu, Jun 2, 2022 at 6:53 PM Michael Van Canneyt via lazarus < lazarus@lists.lazarus-ide.org> wrote: > > > On Thu, 2 Jun 2022, duilio foschi via lazarus wrote: > > > which is the state of art of Lazarus as a web programming tool? > > > > I'd like to know: is it possible to write the classic "fish application" > > http://www.shellplus.com/graphics/fish-explorer-demo.gif > > > > as a web application using Lazarus? > > Yes, this is possible. > > > > > Has somebody done that? > > I believe a Brazilian programmer has done this. It has been put online > somewhere. This is the URL I found, but it seems it is no longer live: > > http://raw.githack.com/pas2js/master/master/ProjFishfacts/www/project1.html > > There seems to be an alternate version at: > > https://macpgmr.github.io/MacXPlatform/WebAppOverview_4.html#FishFacts > > In each case, it should not be too hard to recreate. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] fish application as web application
which is the state of art of Lazarus as a web programming tool? I'd like to know: is it possible to write the classic "fish application" http://www.shellplus.com/graphics/fish-explorer-demo.gif as a web application using Lazarus? Has somebody done that? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] trying to read an EXE
a new world to discover. Thanks a lot Peppe On Sun, Sep 5, 2021 at 4:30 PM Christo Crause wrote: > > On Sun, Sep 5, 2021 at 12:50 PM duilio foschi via lazarus < > lazarus@lists.lazarus-ide.org> wrote: > >> > An alternative is to use a tool such as objdump or dumpbin to >> disassemble the executable file. >> >> objdump seems to be a unix tool. AFAIK dumpbin will only work from Visual >> Studio. >> > > You can get GNU binutils for Windows here: > https://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.28/ > > >> Is there a way to see the assembly on a 2nd monitor while an EXE is run? >> Without having the EXE source code, I mean >> > > This sounds as if you want to debug the executable? This is doable, but > without source code you will have to step through the assembler > instructions manually, or know where in the code to put breakpoints. Use > your favourite Windows debugger, if you don't have one try gdb (part of the > full large Lazarus install I believe). Even if this is what you want to > do, I suggest you dump the disassembled code into a text file, open this > and study it. If the executable is stripped it may be very difficult to > make sense of the assembler code. > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] trying to read an EXE
x Christo ; for the problem in question, I was running short of time, so I went back to the source, fixed the line and recompiled. However this question picked my curiosity and I'd like to know more >The easiest way to see both the machine code, the disassembled code and the Pascal code from inside Lazarus is to place a breakpoint on the line of interest, run until you hit that breakpoint, then switch to the Assembler view. I did that and it is very interesting > An alternative is to use a tool such as objdump or dumpbin to disassemble the executable file. objdump seems to be a unix tool. AFAIK dumpbin will only work from Visual Studio. Is there a way to see the assembly on a 2nd monitor while an EXE is run? Without having the EXE source code, I mean Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] trying to read an EXE
I followed Bart's suggestion and added the -al switch to the fpc.cfg file. This was probably the right move, as - after a new compile - I could see the wanted .s file beside the regular EXE. I uploaded the .s file here: https://mega.nz/file/rlpyHa7b#fx0LYTjapmUdFRkzVGCCzFFogqYuEu7UvYQ5HtilLks I opened the new .s file with a text editor and had a new surprising result: the instruction i:=cmbYear.ItemIndex+2005; is nowhere to be found. I tried to find the figure 2005 both as 07D5 and as D507: no hit. I tried to find the string 'peppe' (that I correctly find in the EXE) in the S file: no hit. I tried to find the string 'peppe' in hex format (7065707065) in the S file: no hit. I tried to understand where the OnClick event could be written, but - with little surprise - I could not. I recompiled with no debug info + using the option 'no optimization'. The new .s file is stored here https://mega.nz/file/X1B2mJpL#smqDJOoDOBZOMoDUpeNutXw3C3YgqHurbdC6L7m2vf4 The new .s file gives no new information than the old one. With all this: the EXE works ok. This case shows that I have a lot of things to learn. Any help? Peppe PS: if interested: unit1.lfm https://mega.nz/file/O1IDhIwb#0SDAninq5yfTOKELksfTRnaXqpIocwh3ugthDzFK2G8 unit1.pas https://mega.nz/file/fgYjFQzJ#wuaS4A7CeTR0Ra35_E5gk8ggGlAFPBqaSJS_p_yi8Ss On Fri, Sep 3, 2021 at 11:07 PM duilio foschi wrote: > today I did an experiment that gave me surprising results (due to my > ignorance, > of course). > > I have an application written in Lazarus and I need to do one fix only. > > This line > >result:=EncodeDate( >cmbYear.ItemIndex+2005, >cmbMonth.ItemIndex+1, >1); > > > needs to be changed into > > >result:=EncodeDate( >cmbYear.ItemIndex+2006, >cmbMonth.ItemIndex+1, >1); > > > I thought it would be easy to use an hex editor like PSPad hex, find the > number > 2005 as 07D5 then fix it (maybe after the right guess in case of multiple > hits). > > To my surprise, I could not find the word 07D5. As I vaguely remember the > big endian/little endian question, I tried to look for D507: no hit. > > In order to dig into the question, I created a Lazarus windows application > made of a TCombobox and a TButton. I used v. 2.0.6 on windows 7. > > I added the following code: > > procedure TForm1.Button1Click(Sender: TObject); > var >a:string; >i:integer; > begin >cmbYear.Items.Add('2020'); >cmbYear.Items.Add('2021'); >Caption:='peppe'; >i:=cmbYear.ItemIndex+2005; >Caption:=inttostr(i); > end; > > I compiled/linked that application then opened the EXE using PsPad Hex. > > Looking for string 'peppe', I can easily spot the part that contains > the code of interest. > > Please see here for a screenshot of PsPad Hex: > https://i.ibb.co/2M054Qx/1.jpg > > (I encircled a few familiar names). > > I cannot understand how this instruction > >i:=cmbYear.ItemIndex+2005; > > is coded here. > > I am no assembly expert, but I expect that the compiler would translate > the instruction into something like > > move 2005 to register X > add register X to register Y (where register Y represents > cmbYear.ItemIndex) > move register Y to register Z(where register Z represents var i) > > In any case I would expect that the figure 2005 (07D5) be written > somewhere, > but facts prove me wrong. > > I am very curious: what really happens in the EXE? > > In which form gets this instruction compiled? >i:=cmbYear.ItemIndex+2005; > > Could someone explain? > > Thank you > > Peppe > > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] trying to read an EXE
today I did an experiment that gave me surprising results (due to my ignorance, of course). I have an application written in Lazarus and I need to do one fix only. This line result:=EncodeDate( cmbYear.ItemIndex+2005, cmbMonth.ItemIndex+1, 1); needs to be changed into result:=EncodeDate( cmbYear.ItemIndex+2006, cmbMonth.ItemIndex+1, 1); I thought it would be easy to use an hex editor like PSPad hex, find the number 2005 as 07D5 then fix it (maybe after the right guess in case of multiple hits). To my surprise, I could not find the word 07D5. As I vaguely remember the big endian/little endian question, I tried to look for D507: no hit. In order to dig into the question, I created a Lazarus windows application made of a TCombobox and a TButton. I used v. 2.0.6 on windows 7. I added the following code: procedure TForm1.Button1Click(Sender: TObject); var a:string; i:integer; begin cmbYear.Items.Add('2020'); cmbYear.Items.Add('2021'); Caption:='peppe'; i:=cmbYear.ItemIndex+2005; Caption:=inttostr(i); end; I compiled/linked that application then opened the EXE using PsPad Hex. Looking for string 'peppe', I can easily spot the part that contains the code of interest. Please see here for a screenshot of PsPad Hex: https://i.ibb.co/2M054Qx/1.jpg (I encircled a few familiar names). I cannot understand how this instruction i:=cmbYear.ItemIndex+2005; is coded here. I am no assembly expert, but I expect that the compiler would translate the instruction into something like move 2005 to register X add register X to register Y (where register Y represents cmbYear.ItemIndex) move register Y to register Z(where register Z represents var i) In any case I would expect that the figure 2005 (07D5) be written somewhere, but facts prove me wrong. I am very curious: what really happens in the EXE? In which form gets this instruction compiled? i:=cmbYear.ItemIndex+2005; Could someone explain? Thank you Peppe -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] editor bug?
I have made the patches for myself. Please do what you like with them. Thank you Duilio. On Tue, Mar 16, 2021 at 9:42 PM Martin Frb via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 15/03/2021 19:01, duilio foschi via lazarus wrote: > > > > You will find a zip file at this link: > > > https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo > > < > https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo> > > > > The zip file contains: > > > > 1. the corrected synedit.pp for Lazarus stable v. 2.0.12 > > 2. the corrected synedit.pp for Lazarus trunk v. 2.1.0 > > 3. the diff file for #1 > > 4. the diff file for #2 > > > > I am not accustomed to version control software. > > > > Please feel free to use the attached fix in the way you like > > > First of all, thanks for the patch. > Please only sent patches, the full files are not needed (and quickly > outdated in case of trunk). > Ideally go to https://bugs.freepascal.org/ register and submit your > patch with a new issue. I can not always deal with patches immediately, > and in my mail inbox they can get lost very quickly. > Once you opened an issue, you can link to it, when you sent an email. > > > Patches against trunk are the correct way. > Other than getting trunk, there is no need to deal with svn or any > revision management system. > > Besides the issues described below, your patch was very helpful, as it > pointed me to the correct location for the fix. And it's review brought > up more issues that need/needed fixing. > > > About the patch itself. > > Both of the issues below, had been present before your patch. So they > are not a result of your patch. > I have fixed the first of the 2 issues, and committed this to trunk 2.1 > > > ***1) > If the text contains tabs, or special chars (such as umlauts äöü, > accents, Japanese, Arabic, ) then it can fail. > > X (in the search code) is a byte position into the string. It is not a > position on the screen. > > https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position > > Consider those Lines: . for spaces, \t shall be a tab, with tab-width = 4 > > ab cd ef gh // 8 spaces "cd" is at x=12 > ab cd ef gh // 8 umlauts (each 2 bytes) "cd" is at x=20 > \t\tab cd ef gh // 2 tabs (same width as spaces) "cd" is at x=6 > ab cd ef gh // 8 spaces "cd" is at x=12 > > However, the "cd" on each line are aligned on the screen. So you can > have a column selection, that in each line has "cd ef g" > If in that column selection you replace "ef" with "EF", then your > ptStartX=12 and ptEndX=19 => will replace nothing in the 2 middle lines. > > > ***2) > Further more, if the text to be replaced occurs twice on a line > ab cd cd ef gh > and "cd" is replaced by "CB and more", then the 2nd "cd" may get pushed > out of the range, before being replaced. > > This is not yet fixed. > According to me test this is "compatible" with Delphi 10.3 > (I.e. it seems to be not working in Delphi too) > > > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
Hi Martin somebody fixed this point, too. See https://mega.nz/file/SkwVwIaS#qC1UeaSGy2kLwEQTSl57CPIYJZY34LYdMQQh7zb9ruY I am sending the unit synedit.pp fixed for both the stable and the trunk version. I can finally work in column mode as I was accustomed to do in Delphi :) HTH Duilio On Sun, Feb 21, 2021 at 5:22 PM Martin Frb via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 21/02/2021 16:53, Juha Manninen via lazarus wrote: > > On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus < > lazarus@lists.lazarus-ide.org> wrote: > >> And one more thing, if you plan to submit a patch, please add an option >> to SynEdit.Options2 >> Many people are used to the current behaviour, I do not plan to upset >> them. >> > > This particular feature should not have an option IMO. > Now it can be considered a missing feature or even a bug. > When a user presses Alt-key when selecting, he clearly wants something > special to happen with Ctrl-C. > > > Well, if the user selects a column selection of a single line, then yes > (probably). > > But if the user selects column over several lines, then pasting already > acts different than it would for a normal selection. > (Select 3 full lines (start to end) using column selection => paste will > be different than the same 3 lines in normal selection) > > And users who grew up without the feature may not like it. > > Now nothing special happens which is a semi-bug. > I am sure everybody will be happy when this feature gets implemented. I > can remember many situations where it would have been useful. > > I don't have an example at hand, but I am sure I have more than a few > times made the experience that small, seemingly really useful changes got > someone coming up wanting the old behaviour back. > > > IMO there are too many options already. > > That is true, or rather they are badly organized. They need break down > into basic, and expert (like the mouse options have) > > If I accidentally change something during my tests, it takes a long time > to figure out what changed and how to revert it. > > Take a copy of your ___Options.xml files. > You can restore or diff them. > > Please add more options only when really needed. > > What I really would want to do, is include config in the keymap. > You could add new commands to the keymap. > > So you would assign ctrl-v to > paste(true) > or >paste(ColumnAdvanceLine) >ecPaste(ColumnAdvanceLine, IndentToContext, TabsToSpaces) > > They look like pascal script, but they would not require pascalscript. > (PascalScript does not work on all platforms, so it can not be used here) > They would always be a single command, with hardcoded options. > > This is like in some browser, you can do config in css, JavaScript or > similar. > > But that is a topic on its own. > > > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] editor bug?
Hi Martin, somebody fixed the bug. You will find a zip file at this link: https://mega.nz/file/T85iARDY#kK9i6JbM-aDJfRafL5PMN2MenSfxJoK4Yg9tnVwGsTo The zip file contains: 1. the corrected synedit.pp for Lazarus stable v. 2.0.12 2. the corrected synedit.pp for Lazarus trunk v. 2.1.0 3. the diff file for #1 4. the diff file for #2 I am not accustomed to version control software. Please feel free to use the attached fix in the way you like Thank you Duilio . On Sat, Feb 20, 2021 at 2:51 PM Martin Frb via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 20/02/2021 10:58, duilio foschi via lazarus wrote: > > I am using Lazarus v. 2.0.6 r. 62129 on windows 7/64 bits. > > > > I found an unexpected behaviours of the editor > > > > 1. I want to delete the text ":string" from the encircled column-sized > > frame > > you see here: > > > > https://i.ibb.co/V9ZPzSf/1.jpg <https://i.ibb.co/V9ZPzSf/1.jpg> > > > > The frame was selected using shift+alt+arrows keys. > > > > 2. when I click the ReplaceAll button also the text from the encircled > > button > > here > > > > https://i.ibb.co/dpFsjNq/2.jpg <https://i.ibb.co/dpFsjNq/2.jpg> > > > > is deleted, what is unexpected. > > > > Isnt this a bug? > > > Yes it is. > > This is not currently implemented, so the Search/Replace should not > allow "in selection" > > You can report it (the unimplemented fearture) as a bug. But it will be > rather some time until that might get implemented (unless someone > contributes). > > > There are some other options to archive what you need. > > Multi caret mode: (you can in Keymap config a key to have all carets > kept, when moving them in any direction) > https://wiki.lazarus.freepascal.org/New_IDE_features_since#Multi_Caret > > Maybe > https://wiki.lazarus.freepascal.org/New_IDE_features_since#Syncron-Edit > > And Editor Macros > record actions for one line, end with positioning one line down => then > play macro repeatedly. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
Hi Martin, thank you for the detailled instructions. Re your question >does the Caret go to the start of the insert, or does it automatically move one line down too? in Delphi/column mode, the caret moves one line down at each insert. 1. starting from this status https://i.ibb.co/jL30yFx/1.jpg I click ctrl+O+C for column mode 2. I select the text 'peppe'+blank then ctrl-c to save the text into memory https://i.ibb.co/99DH4gc/2.jpg 3. using the arrow keys, I move the caret 2 lines down... https://i.ibb.co/ZHGqZx3/3.jpg 4. after I press ctrl-v, the caret moves 1 line down. This is exactly what I miss in Lazarus :) https://i.ibb.co/ZT6LJdD/4.jpg I will try to fix the point. Thank you Duilio On Sun, Feb 21, 2021 at 12:30 PM Martin Frb wrote: > On 21/02/2021 10:02, duilio foschi wrote: > > Hi Martin, > > > > I am too lazy to learn how to use editor scripts. > > > > Probably it will be more productive to spend some time to correct the > > editor code. > > > > After all, the Jedi editor - written in Delphi and available in source > > code - behaves like old Delphi editor in column mode. > > > > How can I try to fix the problem? > > > > Where is the Lazarus repository with the original code of the Lazarus > > editor? > > > > Official: https://svn.freepascal.org/svn/lazarus/ > For bugs and patches: > https://bugs.freepascal.org/set_project.php?project_id=1 > > I am running a mirror at https://github.com/User4martin/lazarus/ > For most SynEdit and Debugger issues, I can accept pull requests (those > go to me only, no one else in the team, therefore limited to work I will > deal with) > > SynEdit is in Components/SynEdit > > If you are looking for the Search/Replace dialog, afaik its in the > folder ide/ . Best to start looking from the file ide/SourceEditor.pp . > But probably you want SynEdit. > > SynEdit.pp > You probably want to look at function TCustomSynEdit.PasteFromClipboardEx > > You should know about the caret pos > > https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position > > You can get/set the caret pas on FCaret. > Also you will look for PMode: TSynSelectionMode; > > This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive > > So then you only need restore the CaretX > > > Now this is important, you will see it works on CaretBytePos (logical) > But you will need CharPos. > > Imagine you copy columns from 2 or more lines. > Then (I guess) you want to set the caret to the start of the column in > the *last* line to which was inserted.. > > If there is a tab at the first line you insert, then you may be at > PhysX=4 and LogX=2 (behind the tab) > If there is no tab in the last line, and you set LogX =2 , well that is > not what you want. > > > - > > Remind me, does the Caret go to the start of the insert, or does it > automatically move one line down too? > > And one more thing, if you plan to submit a patch, please add an option > to SynEdit.Options2 > Many people are used to the current behaviour, I do not plan to upset them. > > The option will then be controlled from the IDE. So the patch will > either wait till I get to do that. > Or if you volunteer ide/EditorOptions.pas (search Options2 or ) > ide/frames/editor_misc_options > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
Hi Martin, I am too lazy to learn how to use editor scripts. Probably it will be more productive to spend some time to correct the editor code. After all, the Jedi editor - written in Delphi and available in source code - behaves like old Delphi editor in column mode. How can I try to fix the problem? Where is the Lazarus repository with the original code of the Lazarus editor? Thank you Duilio On Sat, Feb 20, 2021 at 5:31 PM Martin Frb wrote: > On 20/02/2021 13:11, duilio foschi via lazarus wrote: > > > > pic > > > > https://i.ibb.co/jDBfSpZ/4.jpg <https://i.ibb.co/jDBfSpZ/4.jpg> > > > > shows the result I wanted from the start. I can get it only by several > > uneeded clicks on the arrows keys... > > > https://imgur.com/a/w5uzUhh > > copy > > Then instead of pasting once for each line, press Shift Alt down to set > cursors on each line > Do one single paste. > > If I count correctly, one keystroke more (assuming that Delphi includes > cursor down, in the paste). > If in Delphi you do paste,down,paste,down,... Then in Lazarus its less > keystrokes > > However, multi caret works only when there are no lines to skip (well > you can set carets individually, but thats more work) > > > > 5. > > > > my point is: in Lazarus edit the act of inserting a text which is > > column-selected has the same > > result that the act of inserting a text which is row-selected. It > > would be nice to > > differentiate the results (as it was in Delhi editor) so to satisfy > > different > > needs of the coder. > > > See my other reply: > - Yes it should be added. (as build in) > - You can (in 2.0.10) add a macro that does it > > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
Hi Ryan, not the same result IMHO. 1. I column-select the text shown in https://i.ibb.co/WpL6Rmz/1.jpg Now the clipboard contains the text that extends from point (26,66) to point (26,72) 2. I move the cursor to point (27,66). See https://i.ibb.co/zGqQPPT/2.jpg 3. now I would like to press ctr-v 6 times and get the text inserted in the following 6 rows...but I cant. In fact, after the first insert, the cursor stays on row 27. See https://i.ibb.co/v1FJqzg/3.jpg Instead, it should move to position (28,66) 4. pic https://i.ibb.co/jDBfSpZ/4.jpg shows the result I wanted from the start. I can get it only by several uneeded clicks on the arrows keys... 5. my point is: in Lazarus edit the act of inserting a text which is column-selected has the same result that the act of inserting a text which is row-selected. It would be nice to differentiate the results (as it was in Delhi editor) so to satisfy different needs of the coder. Thank you Duilio On Sat, Feb 20, 2021 at 11:58 AM R.Smith via lazarus < lazarus@lists.lazarus-ide.org> wrote: > I'm not the coder, nor have any answer or thought on the matter, but I > would like to point out that if you select text (any text) and then use a > multi-cursor (pressing Alt+Shift+Down Arrow several times) and then Ctrl-V > to paste, you get such a multi-row paste very easily. > > Whether the mentioned IDE thing gets fixed or not, I find this the easier > way. > > Cheers! > Ryan > > On 2021/02/20 12:06, duilio foschi via lazarus wrote: > > If the coder in charge of the editor reads this, I have a prayer for him: > > 1. > > The text showed in > > https://i.ibb.co/0FQV1L0/3.jpg > > is column-selected using shift+alt+arrow followed by ctrl-C > > 2. using the arrows key, I move the cursor to the position shown in > > https://i.ibb.co/VmbVJtg/4.jpg > > 3. I press ctrl-V. The text ':string' is correctly copied into the > expected position but... look at the cursor > > https://i.ibb.co/PWLfsn9/5.jpg > > The cursor is now at the position after the 'g' in the same row where the > text was copied. > > So in the Lazarus editor there is no difference in copying a text > row-selected > and a text column-selected. > > In Delphi there is a big difference when you copy a text (at least until > v. 7, > when I stopped using it). > > Say you copy a text of lenght L from the clipboard into point (x,y). > If the text is row-selected, Delphi sets the cursor at point (x+L,y), > like the Lazarus editor does. > > But if the text is column-selected, Delphi sets the cursor at point > (x,y+1), > in the row below. > > This enables you to quickly copy several rows of text, as shown here > > https://i.ibb.co/98Y9WnD/6.jpg > > This ability is a big plus for a coder...well... at least I remember I was > using > it often :) > > . > > > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] I say a little prayer (for the Lazarus editor)
If the coder in charge of the editor reads this, I have a prayer for him: 1. The text showed in https://i.ibb.co/0FQV1L0/3.jpg is column-selected using shift+alt+arrow followed by ctrl-C 2. using the arrows key, I move the cursor to the position shown in https://i.ibb.co/VmbVJtg/4.jpg 3. I press ctrl-V. The text ':string' is correctly copied into the expected position but... look at the cursor https://i.ibb.co/PWLfsn9/5.jpg The cursor is now at the position after the 'g' in the same row where the text was copied. So in the Lazarus editor there is no difference in copying a text row-selected and a text column-selected. In Delphi there is a big difference when you copy a text (at least until v. 7, when I stopped using it). Say you copy a text of lenght L from the clipboard into point (x,y). If the text is row-selected, Delphi sets the cursor at point (x+L,y), like the Lazarus editor does. But if the text is column-selected, Delphi sets the cursor at point (x,y+1), in the row below. This enables you to quickly copy several rows of text, as shown here https://i.ibb.co/98Y9WnD/6.jpg This ability is a big plus for a coder...well... at least I remember I was using it often :) . -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] editor bug?
I am using Lazarus v. 2.0.6 r. 62129 on windows 7/64 bits. I found an unexpected behaviours of the editor 1. I want to delete the text ":string" from the encircled column-sized frame you see here: https://i.ibb.co/V9ZPzSf/1.jpg The frame was selected using shift+alt+arrows keys. 2. when I click the ReplaceAll button also the text from the encircled button here https://i.ibb.co/dpFsjNq/2.jpg is deleted, what is unexpected. Isnt this a bug? Duilio -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Fwd: using a weird DLL
for Sven: >Is the function declared inside an "extern "C"" block? no The code says: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Imaging; namespace SkinAnalyzer { public class ImageProcessing { // public ImageProcessing() { // init., if necessary } // // get the features public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle ROI_Rect, double[] ExtractedFeatures) { // check the parameters if (Input_Bitmap == null) return false; if (Input_Bitmap.PixelFormat != PixelFormat.Format8bppIndexed && Input_Bitmap.PixelFormat != PixelFormat.Format24bppRgb && Input_Bitmap.PixelFormat != PixelFormat.Format32bppArgb && Input_Bitmap.PixelFormat != PixelFormat.Format32bppRgb) return false; // get the input pixels Rectangle rect1 = new Rectangle(0, 0, Input_Bitmap.Width, Input_Bitmap.Height); BitmapData input_data = Input_Bitmap.LockBits(rect1, ImageLockMode.ReadOnly, Input_Bitmap.PixelFormat); IntPtr ptr1 = input_data.Scan0; int bytesbpp = 0;// bytes_per_pixel switch (Input_Bitmap.PixelFormat) { On Mon, Feb 1, 2021 at 10:08 AM duilio foschi wrote: > I am corrected. The DLL is written in c#. It seems that Bitmap and > Rectangle are common predefined/usable objects in C#. > > Re Bitmap, I found these notes: > "Surely you cannot expect C# Bitmap to be binary compatible with Delphi > TBitmap? You need to pass around an HBITMAP. On the Delphi side you use > ReleaseHandle to get the HBITMAP. On the C# side it would be > Image.FromHbitmap" > > Re Rectangle, I found nothing interesting :( > > However it seems natural to expect that Rectangle it is given by a pointer > to a fixed array of 2 points= 4 integers= 16 bytes in all. > > Thank you > Duilio > > On Mon, Feb 1, 2021 at 7:52 AM Sven Barth > wrote: > >> duilio foschi via lazarus schrieb am >> So., 31. Jan. 2021, 23:23: >> >>> I would like to use a function exported from a DLL. The DLL was written >>> in C++ (Visual Studio 2015). >>> >>> Inside the original code the function is declared as >>> >>> public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle >>> ROI_Rect, double[] ExtractedFeatures) >>> >>> Anybody knows how to use it from Lazarus? >>> >> >> Can you also show the declarations of Bitmap and Rectangle? Is the >> function declared inside an "extern "C"" block? >> >> Regards, >> Sven >> >>> -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] using a weird DLL
I would like to use a function exported from a DLL. The DLL was written in C++ (Visual Studio 2015). Inside the original code the function is declared as public bool GetSkinFeatures(Bitmap Input_Bitmap, Rectangle ROI_Rect, double[] ExtractedFeatures) Anybody knows how to use it from Lazarus? This is too much for me... Thank you Duilio -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] debugging a CGI
I guess I will use conditional compilation. {$IFDEF WINDOWS} // this means I am debugging the CGI on my PC //read from file xxx.json {$else} // this means the CGI is in production on my linux server // read from stdin {$endif} Thank you for your help Duilio On Wed, Jan 20, 2021 at 1:33 PM Martin Frb via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 19/01/2021 19:03, duilio foschi via lazarus wrote: > > I would like to debug a CGI by tracing it in Lazarus IDE as a console > > application in windows. > > > > Is there a way to have the CGI read from standard input at start time? > > > > I have not tried this, but you may try to debug it using gdbserver. > > Tools > Options > debugger: choose gdbserver and if required change > ip/port 127.0.0.1:1234 > > Now you can start your app on the console (I am not sure what > commandline gdbserver takes / please double check) > DUMMY INSTRUCTION > gdbserver -host ip:port yourapp > > gdbserver will hold your app right at the start. > Your app should be able to read and write to the console from which you > started it. > You can then start debugging in the IDE. > > > Going one step further, if you are real lucky, you can put the above > gdbserver line into a script, and actually run it as cgi in a webserver > (if the webserver does not timeout/kill it) > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] debugging a CGI
How can I trace the code then? On Tue, Jan 19, 2021, 22:11 Michael Van Canneyt via lazarus < lazarus@lists.lazarus-ide.org> wrote: > > > On Tue, 19 Jan 2021, duilio foschi via lazarus wrote: > > > I would like to debug a CGI by tracing it in Lazarus IDE as a console > > application in windows. > > > > Is there a way to have the CGI read from standard input at start time? > > I recommend to host your webmodule in a http server app, this will make > debugging it a lot easier. > > Michael. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] debugging a CGI
I would like to debug a CGI by tracing it in Lazarus IDE as a console application in windows. Is there a way to have the CGI read from standard input at start time? Thank you Duilio -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] using TDBNavigator with a TStringgrid
very good idea. Thank you On Sat, Jan 16, 2021 at 12:00 PM gabor via lazarus < lazarus@lists.lazarus-ide.org> wrote: > W dniu 2021-01-16 o 11:54, duilio foschi via lazarus pisze: > > it does not seem possible. > > > > Any workaround? > > > > Thank you > > > > Duilio > > > > Maybe TMemDataset + TDBGrid + TDBNavigator? > > Michał. > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] using TDBNavigator with a TStringgrid
it does not seem possible. Any workaround? Thank you Duilio -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] question with IDE
my IDE sometimes decides that procedure X was not coded in the implementation section of a unit...and adds an empty definition (see: https://imgur.com/awP7cK2) The procedure is there (see https://imgur.com/6H5F2cG) but for some reason the IDE is brought to the crazy idea above. This always happens with a couple of procedures, always the same. Is there a way to avoid this weird behaviour? Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] UDP server
Oops! Sorry On Tue, Jan 12, 2021, 20:32 Bo Berglund via lazarus < lazarus@lists.lazarus-ide.org> wrote: > On Mon, 11 Jan 2021 20:32:52 +0100, duilio foschi via lazarus > wrote: > > > >Peppe Polpo > > Please do not start a new thread by using an old thread and changing the > subject > and content! > It messes up message threading in newsreaders and email clients, which use > a > hidden "thread" identifier of sorts... > > > -- > Bo Berglund > Developer in Sweden > > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] UDP server
http://www.ararat.cz/synapse/doku.php/public:howto:udpserver this is the code suggested to write a UDP server with synapse. The code uses an infinite loop in a thread. I find this solution rather ugly. I would expect an event OnReceiveData that apparently is not there. The socket allows for a callback procedure of type procedure OnStatus(Sender: TObject; Reason: THookSocketReason; const Value: string); However it seems that this callback only works when the command RecvPacket or similar is issued and as far as the relative timeout does not elapse. Do I understand well? There is now way to use an event to collect data in synapse? An infinite loop is the only way? I miss old ICS (Internet Component Suite) :) Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] weird error message
Yes, it works. Good to know. Thank you On Fri, Aug 21, 2020 at 6:22 PM Juha Manninen wrote: > > On Fri, Aug 21, 2020 at 7:14 PM duilio foschi via lazarus > wrote: > > In Delphi you write > > qryMain.AfterOpen:=TB_DPTAfterOpen; > > > > but whatever works is ok to me :) > > It works also with FPC when using {$mode delphi} > > Juha -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] weird error message
thanks Colin, it worked. In Delphi you write qryMain.AfterOpen:=TB_DPTAfterOpen; but whatever works is ok to me :) On Fri, Aug 21, 2020 at 6:00 PM Colin Western via lazarus wrote: > > qryMain.AfterOpen:=@TB_DPTAfterOpen ? > > Colin > -- > ___ > lazarus mailing list > lazarus@lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] weird error message
1. when the compiler reaches this line,,, qryMain.AfterOpen:=TB_DPTAfterOpen; it throws the error: unit1.pas(190,23) Error: Wrong number of parameters specified for call to "TB_DPTAfterOpen" 2. TB_DPTAfterOpen is declared as: TFrame1=class(TFrame) protected procedure TB_DPTAfterOpen(DataSet: TDataSet); ... 3. qryMain is declared as: qryMain: TSQLQuery; 4. AfterOpen is a TDataSetNotifyEvent AfterOpen: TDataSetNotifyEvent 5. TDataSetNotifyEvent is declared as TDataSetNotifyEvent = procedure(DataSet: TDataSet) of object; Ev seems ok to me. So where is the error? Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] The future of the Lazarus IDE
> I am missing the option "No change wanted towards this direction". > Without this option the poll is biased. this is my humble opinion, too -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] alternative to web programming?
https://www.cybelesoft.com/thinfinity/virtualui/ has somebody tried the product above? Can it be a real alternative to web programming? Thank you Peppe Polpo -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] devmgmt.msc
Hi Jose', doubting a configuration error, I uninstalled Lazarus, then installed it again (current version is 1.8.2). Unfortunately I could not get rid of the error on TLibHandle. Then I found out that this type (TLibHandle) is not declared in system.pas but in rtl/dynlibs.pas http://i67.tinypic.com/20ft940.jpg I fixed the problem by adding dynlibs.pas to the project. Unfortunately when I compile the code I get new error messages (see below) in unit lnfodwrf. See http://i68.tinypic.com/116qrdy.jpg Well, I am sure I will fix all problems before or later :) Thank you Peppe lnfodwrf.pp(846,23) Error: Incompatible types: got "" expected "" -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] devmgmt.msc
Hi Jose', thank you for the code, but 1. I get a number of error messages while compiling the unit with Lazarus 1.6.4 under W7 (see below) 2. I cannot understand how I can get the enumerated COM device names into a TStringList as I need to process the names. Thank you Peppe Compile Project, Target: C:\Users\PCCE88~1.BUF\AppData\Local\Temp\project1.exe: Exit code 1, Errors: 11 udeviceenumwin.pas(83,22) Error: Identifier not found "TLibHandle" udeviceenumwin.pas(83,32) Error: Error in type definition udeviceenumwin.pas(164,23) Error: Operator is not overloaded: "" = "ShortInt" udeviceenumwin.pas(165,88) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(166,96) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(167,101) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(168,97) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(169,102) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(170,90) Error: Incompatible type for arg no. 1: Got "", expected "QWord" udeviceenumwin.pas(184,26) Error: Operator is not overloaded: "" = "ShortInt" udeviceenumwin.pas(184,65) Error: Incompatible type for arg no. 1: Got "", expected "QWord" 2018-03-29 14:22 GMT+02:00 José Mejuto <joshy...@gmail.com>: > El 28/03/2018 a las 22:48, duilio foschi via Lazarus escribió: >> >> if I run devmgmt.msc on W7 I get this info on screen: >> Is there a Winows API I can call from my Lazarus program and get the same >> info ? >> My aim is to detect which COM number was assigned to the USB device >> "MSP Application UART1" > > > Hello, > > Attached unit will help you to implement a COM port browsing. There is a bit > of extra code as original comes from a bigger unit, and this is an extract. > > > -- > -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] devmgmt.msc
if I run devmgmt.msc on W7 I get this info on screen: http://i66.tinypic.com/2lucq4n.jpg Is there a Winows API I can call from my Lazarus program and get the same info ? My aim is to detect which COM number was assigned to the USB device "MSP Application UART1" Thank you Peppe -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Plivo API
Hi Mattias, your code shows what Plivo probably does :) After recording a call, Plivo will call my remote application X (I will write the URI of X in a configuration file) with Https/Post. At the time of the request Plivo passes the URI of a MP3 file to application X. This information is written in a XML file, but lets say a text file just to hide details. I need to write application X. This application X wont make calls, but will be called from 3th party software (Plivo). How do I read the parameters passed when a Https/Post request is done to my code ? Thank you Peppe 2016-10-02 21:36 GMT+02:00 Mattias Gaertner via Lazarus <lazarus@lists.lazarus-ide.org>: > On Sun, 2 Oct 2016 20:45:08 +0200 > duilio foschi via Lazarus <lazarus@lists.lazarus-ide.org> wrote: > >> I am wetting my feet in Plivo API (www.plivo.com). >> >> " >> Plivo communicates with remote applications built by businesses >> through a series of API calls. These back and forth calls between >> Plivo and other applications are communicated through XML (Extensible >> Markup Language). >> " >> >> Say that at a given time Plivo calls application X with HTTPS/Post and >> passes it a XML file. >> >> I need to write a minimal application X in Lazarus that will write the >> XML file to disk >> >> Could you point me to some sample code possibly using Synapse ? > > You don't need Synapse if you only need to download a file. FPC > provides a HTTP client: > > function DownloadText(const URL: string): TStrings; > var > client: TFPHTTPClient; > doc: TStringList; > begin > Result:=nil; > doc:=TStringList.Create; > client:=TFPHTTPClient.Create(nil); > try > client.Get(URL,doc); > Result:=doc; > doc:=nil; > finally > doc.Free; > client.Free; > end; > end; > > > Mattias > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus-ide.org > http://lists.lazarus-ide.org/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Plivo API
I am wetting my feet in Plivo API (www.plivo.com). " Plivo communicates with remote applications built by businesses through a series of API calls. These back and forth calls between Plivo and other applications are communicated through XML (Extensible Markup Language). " Say that at a given time Plivo calls application X with HTTPS/Post and passes it a XML file. I need to write a minimal application X in Lazarus that will write the XML file to disk Could you point me to some sample code possibly using Synapse ? Thank you Peppe Polpo -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus