Re: [fpc-pascal] Parse JSON

2023-06-25 Thread Michael Van Canneyt via fpc-pascal
On Fri, 23 Jun 2023, Darius Blaszyk via fpc-pascal wrote: Hi all, I've hardly done anything with JSON in Freepascal before, so apologies for the trivial question. I want to traverse an array in JSON and retrieve the elements (which I don't know what they are in advance) one by one. An exam

Re: [fpc-pascal] Parse JSON

2023-06-25 Thread Thomas Kurz via fpc-pascal
fpJson fully supports JSON: https://www.freepascal.org/docs-html/fcl/fpjson/index.html https://wiki.lazarus.freepascal.org/JSON There's also JSON support in the LGenerics package, but it's not a bundled package as far as I know. Thomas - Original Message - From: Darius Blaszyk via fp

[fpc-pascal] Parse JSON

2023-06-25 Thread Darius Blaszyk via fpc-pascal
Hi all, I've hardly done anything with JSON in Freepascal before, so apologies for the trivial question. I want to traverse an array in JSON and retrieve the elements (which I don't know what they are in advance) one by one. An example of the JSON file is given below. "keywords": { "ke

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
scal Variant type does not handle interfaces by default. Take a > look: > > https://wiki.freepascal.org/Variant > > Best, > R > -- next part -- > An HTML attachment was scrubbed... > URL: < > http://lists.freepascal.org/pipermail/fpc-pascal/attachmen

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread James Richters via fpc-pascal
So it’s broken? It seems like the link you provided is trying to show a workaround, but I don’t know how I could apply that. >"Remark Dispatch interface support for variants is currently broken in the >compiler." (https://www.freepascal.org/docs-html/ref/refsu20.html) ___

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
Hi James, Sorry, I missed the following reference: "Remark Dispatch interface support for variants is currently broken in the compiler." (https://www.freepascal.org/docs-html/ref/refsu20.html) Best, R > ___ fpc-pascal maillist - fpc-pascal@lists.fre

Re: [fpc-pascal] SDL2 Event Registration (and case statements)

2023-06-25 Thread Rafael Picanço via fpc-pascal
Thanks Guilhermo, Just to clarify, I do have a limited number of events. Lets say, 2 events. So, using the SDL_RegisterEvents function, is it possible to define these two new events as normal constants so they will be known at compile time and will make Free Pascal case statements happy? Best, R

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
Hi James, > SpVoice : Variant; > SpVoice := CreateOleObject('SAPI.SpVoice') The Free Pascal Variant type does not handle interfaces by default. Take a look: https://wiki.freepascal.org/Variant Best, R ___ fpc-pascal maillist - fpc-pascal@lists.freep

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread James Richters via fpc-pascal
Ooops forgot the link: https://wiki.lazarus.freepascal.org/SAPI From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Sunday, June 25, 2023 8:52 AM To: 'FPC-Pascal users discussions' Cc: James Richters Subject: [fpc-pascal] Microsoft SAPI on Freepascal I am trying to get Microsof

[fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread James Richters via fpc-pascal
I am trying to get Microsoft speech synthesis to work with Freepascal. I am trying to follow the guide here: I don't know what I am doing wrong. SAPI is working on my system, because the TTSApp Demo that comes with the Microsoft Speech SDK works fine. Here is my test program: {$mode objf

Re: [fpc-pascal] SDL2 Event Registration (and case statements)

2023-06-25 Thread Guillermo Martínez Jiménez via fpc-pascal
Hi. > The SDL2 documentation recommends you to register constants with: > > Uint32 SDL_RegisterEvents(int numevents); >numevents = the number of events to be allocated. >Returns the beginning event number, or (Uint32)-1 if there are not > enough user-defined events left. > > The SDL_Regi

Re: [fpc-pascal] 3123 inherited not supported inside inline

2023-06-25 Thread Michael Van Canneyt via fpc-pascal
On Sun, 25 Jun 2023, Hairy Pixels via fpc-pascal wrote: On Jun 24, 2023, at 10:27 PM, Michael Van Canneyt via fpc-pascal wrote: It seems to me no gain is to be had from e.g. inlining a routine of 500+ lines of code. What if the function was only called from 3 places in the program and