Re: [fpc-pascal] "Unexpected end of file" when having an open comment after the final "end."

2024-02-08 Thread Travis Siegel via fpc-pascal
No, the original post has the correct program, dropping a ";" in that spot is incorrect syntax. The problem comes in because there is an open comment, but no close comment.  If you add the closing } the compiler behaves properly. On the other hand, I do understand that once the "end." is

Re: [fpc-pascal] What's in Hello World

2024-01-08 Thread Travis Siegel via fpc-pascal
On 1/7/2024 1:09 PM, Florian Klämpfl via fpc-pascal wrote: Am 07.01.2024 um 13:21 schrieb Ingemar Ragnemalm via fpc-pascal : Just for comparison, I fired up Think Pascal and made Hello world! Plain Hello world, closes so quickly that you don't have time to see it: 4625 bytes. Including

Re: [fpc-pascal] What's in Hello World

2024-01-08 Thread Travis Siegel via fpc-pascal
For what it's worth, the hello world program in powerbasic (https://www.powerbasic.com) comes to a whooping 7,168 bytes. That's the console version, not the gui version, that's a bit bigger, but by not much more.  I have an epub reader I've been working on for a few years, on and off, and that

Re: [fpc-pascal] A new FP-like fork of Oberon

2023-10-27 Thread Travis Siegel via fpc-pascal
I too would like this system if possible. On 10/27/2023 6:19 AM, Adriaan van Os via fpc-pascal wrote: Liam Proven via fpc-pascal wrote: On Thu, 26 Oct 2023 at 08:57, Adriaan van Os via fpc-pascal wrote: It might interest you that I ported the Oberon-0 compiler, from the book Compiler

Re: [fpc-pascal] ideas for using a speech-to-text model with a fpc program

2023-09-28 Thread Travis Siegel via fpc-pascal
I'm not exactly sure what the end goal is, but Microsoft has API calls for text to speech.  I don't know if they have any for the language you're using, but if they do, sending the text to the speech routines is fairly straightforward in FPC, In fact, there was a discussion about that very

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
Also, for what it's worth, your code works fine on fpc 3.20. On 6/26/2023 11:04 PM, James Richters via fpc-pascal wrote: I appreciate the help with this. I'm still confused. In my original post, I already had CoInitialize, CoUninitialize; and Unit ComOBJ, Unit Windows and Unit ActiveX I

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
Hmm, ok, apparently something changed in the way FPC handles objects between 3.31 and 3.20 (the version I'm using). Thought I had 3.22, but . I guess it could be a sapi version difference too, but I don't know how to check that. On 6/26/2023 11:15 PM, James Richters wrote: When I run the

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
On 6/26/2023 6:26 PM, Michael Van Canneyt via fpc-pascal wrote: On Mon, 26 Jun 2023, James Richters wrote: I tried to make your example into a FPC program without Lazarus: {$mode objfpc}{$H+} uses  comobj; var  SavedCW: Word;  v: OleVariant; begin   v:=CreateOleObject('SAPI.SpVoice');  

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
On 6/26/2023 3:51 PM, Michael Van Canneyt via fpc-pascal wrote: Try changing the selected voice to 0 instead of 1. Yeah, already tried that, didn't help any. *grumble* Because I use a screen reader, I have multiple sapi voices installed, (though I rarely use them), but I haven't played with

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
Thank you, this one works for me with a command line compile.  I compared the two programs, and the line that asks for the voices is the culprit. I'll have to do some digging to see why that line breaks the runtime execution. But at least I can make it work now.  I'd always used powerbasic

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Travis Siegel via fpc-pascal
Does the form code do something different than the command line? When I try to run this code, I get an unhandled exception error. Any idea how to fix? On 6/26/2023 1:54 PM, Michael Van Canneyt via fpc-pascal wrote: On Sun, 25 Jun 2023, James Richters via fpc-pascal wrote: I gave up on

Re: [fpc-pascal] Legitimate use of for and break

2023-06-18 Thread Travis Siegel via fpc-pascal
On 6/18/2023 6:53 AM, Bernd Oppolzer via fpc-pascal wrote: The compiler is a self-hosting compiler (like most Pascal compilers, I believe) and up to 2011 there were many exits from loops bye putting a label after the loop and using GOTO (because of the absence of BREAK). Similar use of GOTO

Re: [fpc-pascal] Legitimate use of for and break

2023-06-18 Thread Travis Siegel via fpc-pascal
On 6/18/2023 1:04 AM, Hairy Pixels via fpc-pascal wrote: I don't remember break NOT being in Pascal. How did you exit a loop otherwise, goto? Break is common in basically all languages now. Can't think of a language I've used without it. Use a variable, set the variable when you hit an exit

Re: [fpc-pascal] Legitimate use of for and break

2023-06-17 Thread Travis Siegel via fpc-pascal
This is interesting, because it's the first time I've ever seen "break" as a valid command in pascal, and I've been using pascal since the mid/late 80s.  All kinds of dialects too, and I've never seen break as a keyword.  C, Python, Perl, sure, even shell scripts, but pascal? Never seen it

Re: [fpc-pascal] Function to create a record ?

2023-06-04 Thread Travis Siegel via fpc-pascal
Depending on the compiler *not* to overwrite local variables is most certainly the wrong way to go with this.  You really should create either a global record/object, or use functions to pass around the information you need.  Expecting the operating system to keep local variables after the

Re: [fpc-pascal] Why does RunCommand not produce the correct output?

2023-05-01 Thread Travis Siegel via fpc-pascal
May 2023 14:25:28 -0400, Travis Siegel via fpc-pascal wrote: You could just add the line: #!/bin/bash to the first line of your script, then just call the script from your program. Alternatively, you could call the bash command, and pass the command to it that way, either one should get you

Re: [fpc-pascal] Why does RunCommand not produce the correct output?

2023-05-01 Thread Travis Siegel via fpc-pascal
As mentioned in another post, you'll need to run a shell, (whether it be bash or another system provided shell), in order to process the commands.  If you run the commands directly, there is no shell interpretation, and the | which passes the output of one command to the input of the next one

Re: [fpc-pascal] Oberon-0

2023-04-18 Thread Travis Siegel via fpc-pascal
Gcc has already been ported to the propeller II, (and it runs on the original propeller too), so porting other languages should be "relatively" easy.  I've not made the attempt to port anything yet though, mostly because I've been out of the propeller world for a couple years, and now that the

Re: [fpc-pascal] Pause Key

2023-04-13 Thread Travis Siegel via fpc-pascal
I know of no way to obtain the pause key status under windows.  I can get the scroll lock status, but not the pause key, never did figure that one out.  Windows uses it though, I don't know if it's a standard thing, or something I have installed, (though if it is an installed program, I

Re: [fpc-pascal] Converting old pascal written for Pascal/MT+ compiler

2023-04-04 Thread Travis Siegel via fpc-pascal
I'm not positive, because I've never used them, but I'm pretty sure variables configured as const, can't be changed once they're defined.  If that's your intent, then feel free to use them, but it sounds like you're trying to make variables (not constant values) last for the whole program,

Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Travis Siegel via fpc-pascal
Generally, raspberry pi devices connected to other devices will (by default) use python for their programming.  The python libs have all the setup and tear down code built in.  You can use C as well, so I see no reason why FPC couldn't be used.  It's probably going to take some work though. 

Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Travis Siegel via fpc-pascal
On unix (and all of it's derivatives, everything is a file, including connections to other systems.  You can treat it like a file, and in (most) circumstances, it will operate just as if it were a local file. Some devices require special handling, but for the most part, if it's listed as a

Re: [fpc-pascal] Cross-compile for Linux Arm (RaspberryPi) on Windows 10?

2023-03-25 Thread Travis Siegel via fpc-pascal
If you're not opposed to copying files anyhow, why not setup a script to do the compile for you on the pi? You just need to setup your pi with ssh keys, then use scp to move the files, ssh to do the login, then just run the shell script to do the compiling. If you configure the ssh keys

[fpc-pascal] possible bug in blockwrite

2023-03-05 Thread Travis Siegel via fpc-pascal
I'm using FPC 3.2.0, though I doubt anything changed in the most recent releases, though I'll try those if folks think it's worth doing so. What I ran across yesterday while doing a search for other things was some posts about updating a single line in a file using free pascal.  The solutions

Re: [fpc-pascal] FreePascal and the OrangePi

2022-10-21 Thread Travis Siegel via fpc-pascal
When I installed fpc on my raspberry pi, I compiled from source, but that was when the pi was relatively new.  I'm fairly certain there's a release for the pi.  If the orange one has an arm processor, the release for the raspberry should work on the orange as well. On 10/21/2022 6:19 PM,

Re: [fpc-pascal] mciSendString with long file names

2022-09-22 Thread Travis Siegel via fpc-pascal
not asynchronous. James -Original Message- From: fpc-pascal On Behalf Of Travis Siegel via fpc-pascal Sent: Thursday, September 22, 2022 3:27 PM To: ja...@productionautomation.net; FPC-Pascal users discussions Cc: Travis Siegel ; James Richters Subject: Re: [fpc-pascal] mciSendString

Re: [fpc-pascal] mciSendString with long file names

2022-09-22 Thread Travis Siegel via fpc-pascal
: fpc-pascal On Behalf Of Travis Siegel via fpc-pascal Sent: Wednesday, September 21, 2022 4:15 PM To: FPC-Pascal users discussions Cc: Travis Siegel ; Jean SUZINEAU Subject: Re: [fpc-pascal] mciSendString with long file names Adding a backslash (\) before each space should do the job nicely

Re: [fpc-pascal] mciSendString with long file names

2022-09-21 Thread Travis Siegel via fpc-pascal
Adding a backslash (\) before each space should do the job nicely.  I have had similar issues on linux and windows with some commands, and adding the escape characters to the filename almost always fixes the problem.  The only time it didn't, was when the filename started with a dash "-"

Re: [fpc-pascal] Get highest element of a StringList

2022-09-10 Thread Travis Siegel via fpc-pascal
But, if that (eventually) leads to the highest one, and that's all that's desired, why not just use the whole expression variable := pred(f.Count) instead of the whole loop? Wouldn't that accomplish the same thing? Why the loop? On 9/10/2022 3:44 PM, Thomas Kurz via fpc-pascal wrote: If

Re: [fpc-pascal] Cross-compiler for ARM64 on Windows available?

2022-06-23 Thread Travis Siegel via fpc-pascal
There actually is a 64-bit version of xp, but it's not compatible with very much.  Apparently, it didn't have an emulator in it, so running 32-bit software wasn't something it did by default.  I never did figure out if it could be made to run 32-bit software or not, I just gave up on it, (more

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

2021-12-03 Thread Travis Siegel via fpc-pascal
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 you to bypass any roll overs of any kind (unless it goes past the

Re: [fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

2021-10-16 Thread Travis Siegel via fpc-pascal
On 10/16/2021 6:06 PM, Bo Berglund via fpc-pascal wrote: Meanwhile the strace outputs stuff like this to the screen: strace: Process 6360 attached strace: Process 6361 attached strace: Process 6362 attached strace: Process 6363 attached strace: Process 6364 attached strace: Process 6365

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Travis Siegel via fpc-pascal
I don't know how much it will help, but windows has a similar command to linux ifconfig, only on windows it's called ipconfig. Hope this helps. On 9/10/2021 3:03 AM, Bo Berglund via fpc-pascal wrote: Is there a way to enumerate the active adapters on a Windows computer with their IPv4 and

Re: [fpc-pascal] Hello, new Pascal programmer. had a question!

2021-08-31 Thread Travis Siegel via fpc-pascal
Although not likely in this case, I am visually impaired, use a screen reader, and find the Lazarius IDE nearly unusable.  Of course, I've not touched it in years, because my first attempt at using it failed miserably, so for me, I simply use notpad, pico, nano, or text edit (depending on what

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-17 Thread Travis Siegel via fpc-pascal
Heh, how very cool.  I wasn't aware powershell could do such things.  All kinds of new things learned in this thread.  Thanks for that. On 6/17/2021 5:08 AM, Jean SUZINEAU via fpc-pascal wrote: 10 kb of Powerbasic ... you're cheating, it's pascal here ;-) You can do this with just 1kb of

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Travis Siegel via fpc-pascal
Thanks for the sample.  For what it's worth, I got the executable down to just 10K using powerbasic version 6,  I suspect that's as small as it can get, since I did have to include a winbase.inc that comes with the compiler to get the function call of the GetTickCount64 call.  But then again,

Re: [fpc-pascal] Can a console app running as Linux service restart itself?

2021-05-20 Thread Travis Siegel via fpc-pascal
If you didn't have the configuration setup as required, you could still spawn a second process to kill and restart your process as well, this works too, but Michael's suggestion is probably much cleaner, and in all likelihood, is probably the preferred method, but I know folks struggle with

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-19 Thread Travis Siegel via fpc-pascal
On 5/19/2021 9:53 AM, Henry Vermaak wrote: On Wed, 19 May 2021 at 14:36, Travis Siegel via fpc-pascal wrote: No doubt your sleep code works just fine. I'm not saying the sleep command doesn't work. I'm saying the sleep command doesn't release unused cpu cycles for other threads/programs

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-19 Thread Travis Siegel via fpc-pascal
/2021 6:02 AM, Mattias Gaertner wrote: On Tue, 18 May 2021 18:37:38 -0400 Travis Siegel via fpc-pascal wrote: Apparently, you can release cpu cycles, but it's with the sched_yield (section 2 in the man pages), not the sleep command on linux. What sleep command are you referring to? What do you

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Travis Siegel via fpc-pascal
Apparently, you can release cpu cycles, but it's with the sched_yield (section 2 in the man pages), not the sleep command on linux. So, apparently, the sleep is still using full system recourses, even though it's just waiting.  You apparently have to release cpu time with the sched_yield

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Travis Siegel via fpc-pascal
I'm not positive, but I'm pretty sure the sleep command in linux does not behave the same way it does in windows. As you know, in windows, a sleep command (even if delivered with a parameter of 0) gives up time slices to other programs on the system.  This does not appear to be the case on

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

2021-05-17 Thread Travis Siegel via fpc-pascal
The -dev part of the package is necessary for the headers used for compiling, any target system running the finished product will not require the -dev version of the packages to be installed, since they won't be using the header files directly. On 5/17/2021 6:20 PM, Bo Berglund via

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

2021-05-06 Thread Travis Siegel via fpc-pascal
On 5/6/2021 7:54 AM, Bo Berglund via fpc-pascal wrote: On Wed, 5 May 2021, Nico Neumann via fpc-pascal wrote: Indy has support for OpenSSL 1.1.1, just not officially (yet). See https://github.com/IndySockets/Indy/pull/299 THe SMTP server I use requires SSL on port 465. I have only ever

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Travis Siegel via fpc-pascal
On 4/18/2021 11:55 AM, Graeme Geldenhuys via fpc-pascal wrote: On 17/04/2021 10:09 pm, Sven Barth via fpc-pascal wrote: but Delphi compatbility is more important here, thus the default is a warning and not an error. How is this beneficial? The compiler should help the developer, but here it

Re: [fpc-pascal] Formatting Question

2021-04-03 Thread Travis Siegel via fpc-pascal
You can always convert the number to a string, then format it accordingly.  It's probably not the solution you want, but it will do the trick. On 4/3/2021 11:43 AM, James Richters via fpc-pascal wrote: I'm looking for a way to format numerical data in a string so that everything ends up

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-12 Thread Travis Siegel via fpc-pascal
How it's done in FPC I don't know, but in other language tools I use, it requires a resource file with spefic information in it.  I can never remember all the details, so I have to keep a template resource file around with the required information in it, and change it for each program  work

Re: [fpc-pascal] TurboVision is reborn as FOSS (again)

2020-12-23 Thread Travis Siegel via fpc-pascal
On 12/22/2020 11:43 AM, Markus Greim via fpc-pascal wrote: Wow.. Programming languages I worked with in the last 40 years: 12. SPIN When you say spin, I'm assuming you're talking about the parallax propeller boards programming language.  The propeller 2 is coming out shortly (already

Re: [fpc-pascal] TurboVision is reborn as FOSS (again)

2020-12-21 Thread Travis Siegel via fpc-pascal
I don't know what non native english speakers are taught, nor can I address the folks across the pond, but here in the Us at least, has denotes currently exists, while had indicates past tense, I.E. no longer exists.  Combining the two is where it gets dicy, and is generally avoided for

Re: [fpc-pascal] Thread problem

2020-09-06 Thread Travis Siegel via fpc-pascal
I'm not sure it works properly on windows. When I modify this to start two threads, and print out messages based on their start/stop times, as well as a message inside the thread, I get both ending messages before I get only a single printout from within the threaded function.  This seems to

Re: [fpc-pascal] Archive libraries

2020-08-20 Thread Travis Siegel via fpc-pascal
There's also bzip2 and chm (though I don't really consider that an archive format).  I don't see anything for arj or rar though, both of which I use extensively.  Perhaps I'll see what I can do about those two.  arj should be easy enough, since unarj source is available, it should be