Re: [fpc-pascal] case statement

2023-12-25 Thread Steve Litt via fpc-pascal
Gerhard Scholz via fpc-pascal said on Sat, 16 Dec 2023 20:07:45 +0100 >I never had the problem because before the else I always inserted a ";" I know it's 50+ years too late for me to submit ideas for the Pascal language, but in my perfect world you could put a semicolon at the end of anything,

Re: [fpc-pascal] What is webasssembly?

2023-10-11 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Wed, 11 Oct 2023 08:27:35 +0200 (CEST) >On Tue, 10 Oct 2023, Steve Litt via fpc-pascal wrote: > >> What is webasssembly? > >A bytecode format (similar to what is used in Java and C# runtimes) >which is an open standard and wh

[fpc-pascal] What is webasssembly?

2023-10-10 Thread Steve Litt via fpc-pascal
What is webasssembly? SteveT Steve Litt Autumn 2023 featured book: Rapid Learning for the 21st Century http://www.troubleshooters.com/rl21 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

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

2023-07-01 Thread Steve Litt via fpc-pascal
Santi via fpc-pascal said on Sat, 1 Jul 2023 10:22:48 +0200 >El 16/06/2023 a las 16:09, Mattias Gaertner via fpc-pascal escribió: >> On Fri, 16 Jun 2023 20:51:42 +0700 >> Hairy Pixels via fpc-pascal wrote: >> On Jun 16, 2023, at 6:23 PM, Thomas Kurz via fpc-pascal wrote: >> 20

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Steve Litt via fpc-pascal
Steve Litt via fpc-pascal said on Mon, 26 Jun 2023 22:26:17 -0400 >Where does one get ComObj? On my box this errored out with: I went off half cocked. I'm using Linux. Is ComObj even available on Linux? Would you expect Voice := CreateOLEObject('SAPI.SpVoice') and Voice.Speak('I am speak

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Steve Litt via fpc-pascal
Rik van Kekem via fpc-pascal said on Mon, 26 Jun 2023 16:12:06 +0200 >program Project1; >{$mode objfpc}{$H+} >uses >   Classes, ComObj; >var >   Voice: olevariant; >begin >   Voice := CreateOLEObject('SAPI.SpVoice'); >   Voice.Speak('I am speaking.', 0); >   Voice.Speak('I am also speaking.',

Re: [fpc-pascal] Subscript pointers

2023-06-26 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Mon, 26 Jun 2023 18:52:16 +0700 >> On Jun 26, 2023, at 3:48 PM, Steve Litt via fpc-pascal >> wrote: >> >> Why do you need pointers at all? Pointers aren't *usually* an asset. >> > >Seriously? anytime you allocate somet

Re: [fpc-pascal] Subscript pointers

2023-06-26 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Sun, 25 Jun 2023 11:20:53 +0700 >> On Jun 24, 2023, at 8:00 PM, Steve Litt via fpc-pascal >> wrote: >> >> I don't do much with Pascal pointers, but it looks to me like you: >> >> * Set p to the address of i >>

Re: [fpc-pascal] Subscript pointers

2023-06-24 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Thu, 22 Jun 2023 20:23:13 +0700 >I've forgotten entirely, what does subscripting a pointer do in >Pascal? p[0] returns 100 but after that garbage. Seems like a c-style >array which doesn't feel right in the language. > >var > i: Integer; > p: PInteger; >begin

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

2023-06-21 Thread Steve Litt via fpc-pascal
wkitty42--- via fpc-pascal said on Wed, 21 Jun 2023 08:07:59 -0400 >On 6/20/23 10:54 PM, Steve Litt via fpc-pascal wrote: >> It was a long time ago, but if I remember correctly the >> Whitesmith Pascal and Turbo Pascal 2 and 3 had either break or >> continue. If I rememb

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

2023-06-20 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Tue, 20 Jun 2023 14:05:04 +0700 >> On Jun 20, 2023, at 1:10 PM, Steve Litt via fpc-pascal >> wrote: >> >> I can still make a good argument for what my professors taught me, >> but in the intervening years, I found break and es

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

2023-06-20 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Sun, 18 Jun 2023 08:04:23 +0700 >> On Jun 18, 2023, at 1:07 AM, tsie...@softcon.com wrote: >> >> 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

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

2023-06-16 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Fri, 16 Jun 2023 09:57:36 +0700 >> On Jun 16, 2023, at 6:07 AM, Steve Litt via fpc-pascal >> wrote: >> >> Is http://sprunge.us/MOJIg4 a legitimate use of a for loop with >> break? I know there are better ways to do it, but I'm

[fpc-pascal] Legitimate use of for and break

2023-06-15 Thread Steve Litt via fpc-pascal
Is http://sprunge.us/MOJIg4 a legitimate use of a for loop with break? I know there are better ways to do it, but I'm just wondering whether it's legitimate. SteveT Steve Litt Autumn 2022 featured book: Thriving in Tough Times http://www.troubleshooters.com/bookstore/thrive.htm

Re: [fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-12 Thread Steve Litt via fpc-pascal
Nikolay Nikolov via fpc-pascal said on Mon, 12 Jun 2023 09:15:17 +0300 >On 6/12/23 04:44, Steve Litt via fpc-pascal wrote: [snip] >> So, subject to your guidance, I'm assuming FPC isn't optimized for >> tail recursion. Is my assumption an accurate one? > >FPC su

Re: [fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-12 Thread Steve Litt via fpc-pascal
Marco van de Voort via fpc-pascal said on Mon, 12 Jun 2023 09:12:22 +0200 >On 12-6-2023 08:15, Nikolay Nikolov via fpc-pascal wrote: > >Shouldn't the recursive call assign the result? > >> nextt(num - 1); > > >nextt:=nextt(num - 1); > > >if you don't use the result, the whole call may be

Re: [fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-12 Thread Steve Litt via fpc-pascal
Jean SUZINEAU via fpc-pascal said on Mon, 12 Jun 2023 18:04:07 +0200 >According to you other posts, I won't be surprised that you think in a >C/C++ way. :-) Busted! I used Pascal 1984-1993, and C 1986-present with C++ (hate it) 1990-1998. So I long ago forgot the details of pascal, and program

[fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-11 Thread Steve Litt via fpc-pascal
Hi all, Tail recursion is recursion in which absolutely nothing gets executed after the return statement. Some programming languages, including Guile, optimize for tail recursion such that tail recursive algorithms don't use additional stack space as you pile up more and more levels of recursion.

Re: [fpc-pascal] Non-initialized member access warning

2023-06-07 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Wed, 7 Jun 2023 15:44:43 +0700 >I'm curious, why doesn't the following code give a warning? Shouldn't >the compiler know you're assigning to "r" which hasn't been >initialized yet? > >type > TMyClass = class > x: integer; > end; >

[fpc-pascal] General FOSS discussion, 6/7/2023

2023-06-07 Thread Steve Litt via fpc-pascal
Hi all, Sorry for the late notice. GoLUG's mailing list is down so I couldn't get input on a topic earlier. Tonight at 7:00 Eastern Daylight time, 6/7/2023, GoLUG is having an online discussion of anything involving Free and Open Source Software (FOSS). The meeting location is

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

2023-06-05 Thread Steve Litt via fpc-pascal
Jean SUZINEAU via fpc-pascal said on Mon, 5 Jun 2023 11:56:59 +0200 >Hello, I have a hard time trying to understand what you want to test. > >In your functions, you are using a record, not a class or a pointer to >record or an object. > >The personrecord just behave in your parameters and return

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

2023-06-04 Thread Steve Litt via fpc-pascal
Travis Siegel via fpc-pascal said on Sun, 4 Jun 2023 19:38:44 + > >On 6/4/2023 1:37 PM, Steve Litt via fpc-pascal wrote: >> Henry Vermaak via fpc-pascal said on Fri, 2 Jun 2023 09:38:17 +0100 >> >>> On Fri, 2 Jun 2023 at 01:36, Steve Litt via fpc-pascal >>&

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

2023-06-04 Thread Steve Litt via fpc-pascal
Ralf Quint via fpc-pascal said on Thu, 1 Jun 2023 17:43:58 -0700 >On 6/1/2023 5:36 PM, Steve Litt via fpc-pascal wrote: >> >> What is the best way for me to construct newperson() so that every >> time called it would return a new variable? >W.T.F.? > >S

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

2023-06-04 Thread Steve Litt via fpc-pascal
Henry Vermaak via fpc-pascal said on Fri, 2 Jun 2023 09:38:17 +0100 >On Fri, 2 Jun 2023 at 01:36, Steve Litt via fpc-pascal > wrote: >> fillchar(junkvar, junkvar_size, 'b'); >> person := modperson(person, 'Martin'); >> person := modperson(perso

[fpc-pascal] Function to create a record ?

2023-06-01 Thread Steve Litt via fpc-pascal
Hi all, I'm trying to create a function (called newperson()) that creates a new instance of a record. The following compiles with no errors or warnings in FPC, but multiple calls to newperson() produce exactly the same variable, so in the preceding changing person changes person2, and vice versa:

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-30 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Tue, 30 May 2023 16:55:16 +0200 (CEST) >On Tue, 30 May 2023, Hairy Pixels via fpc-pascal wrote: > >> >> >>> On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal >>> wrote: >>> >>> >>> In C you need to do something like this: >>> >>>

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-25 Thread Steve Litt via fpc-pascal
Benito van der Zander via fpc-pascal said on Wed, 24 May 2023 13:00:04 +0200 >I regret installing Linux. Everything worked better with Windows 98 >and Delphi 4 Why not just take your Win98 install disk, install win98, then take your Delphi 4 install disk, install Delphi 4, and you're all set.

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15 +0200 (CEST) >Assuming the result of A is not used outside of Test, the following is >the only solution: > >procedure Test; > >var > A : TObject; >begin > A:=TObject.Create; > Try > // call some code in other unit which

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-22 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Sun, 21 May 2023 09:47:15 +0200 (CEST) >On Sun, 21 May 2023, Hairy Pixels via fpc-pascal wrote: > >> I've never really used exceptions myself in Pascal (with the >> exception of breaking out of deeply recursive function calls) so I >> don't know all the

Re: [fpc-pascal] override and virtual: was SetFileTime

2023-05-03 Thread Steve Litt via fpc-pascal
Giuliano Colla via fpc-pascal said on Wed, 3 May 2023 19:33:25 +0200 > >Override: When you're dealing with objects, you have the >inheritance, that is you may derive a new class (the template of an >object) from an existing class and the newly created class inherits >all the

[fpc-pascal] override and virtual: was SetFileTime

2023-05-03 Thread Steve Litt via fpc-pascal
José Mejuto via fpc-pascal said on Wed, 3 May 2023 11:35:50 +0200 >Hello, > >Attached is a dirty implementation of "touch" for junctions == TTouchJunction = class(TCustomApplication) protected procedure DoRun; override; function

[fpc-pascal] sound(FREQUENCY) on Linux ?

2023-04-14 Thread Steve Litt via fpc-pascal
Hi all, On DOS and Windows programs using Turbo Pascal, I did the following to make a sound of frequency FREQUENCY play through the speakers: sound(FREQUENCY); The following command stopped the tone: nosound; These two commands don't work on Linux, according to my experience and FPC

[fpc-pascal] As I predicted

2023-04-14 Thread Steve Litt via fpc-pascal
Hi all, As I predicted, here's what happened to me on #fpc: == Joanna sets ban on $a:stevelitt * You have been kicked from #fpc by Joanna (sorry i cant share a channel with you after what you said in mailing list)

[fpc-pascal] I registered #fpc-alt and ##fpc-alt

2023-04-13 Thread Steve Litt via fpc-pascal
For those of you who can't get onto Libera.Chat channel #fpc, or would prefer a less stressful enforcement of the rules, I just created community channel #fpc-alt for ontopic and informal channel ##fpc-alt for offtopic. I haven't yet created the topic for these channels, but basically no personal

Re: [fpc-pascal] IRC channel for FreePascal support ?

2023-04-13 Thread Steve Litt via fpc-pascal
Karoly Balogh via fpc-pascal said on Thu, 13 Apr 2023 16:00:46 +0200 (CEST) >Can we keep this discussion civil? Personal attacks and ridiculing >someone is not the way to deal with disagreements. > >Charlie Sorry. From now on I'll conform with the preceding. SteveT Steve Litt Autumn 2022

Re: [fpc-pascal] IRC channel for FreePascal support ?

2023-04-13 Thread Steve Litt via fpc-pascal
I bet this Joanna character is an active member of her Homeowners Association. I verified that there is an operator named Joanna on #fpc on Libera.Chat. The power-hungry kind of behavior exhibited by Joanna is bad for the channel and therefore bad for the project. In another post Jacob mentioned

Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-31 Thread Steve Litt via fpc-pascal
Wols Lists via fpc-pascal said on Sat, 31 Dec 2022 15:07:41 + >On 31/12/2022 08:37, Steve Litt via fpc-pascal wrote: >> Anthony Walter via fpc-pascal said on Thu, 29 Dec 2022 07:31:57 -0500 >> >>> @youngman >>> >>> "I'm a database guy

Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-31 Thread Steve Litt via fpc-pascal
Anthony Walter via fpc-pascal said on Thu, 29 Dec 2022 07:31:57 -0500 >@youngman > >"I'm a database guy with maybe 30 years experience, I'm new to SQL and >oh my god is it an over-complicated monster ..." I'll say this: It certainly doesn't help that there are different variations of SQL.

Re: [fpc-pascal] Be careful of too many features

2022-05-30 Thread Steve Litt via fpc-pascal
Brian via fpc-pascal said on Mon, 30 May 2022 22:36:00 -0400 >On 5/30/22 14:59, Steve Litt via fpc-pascal wrote: >> Hi all, >> >> In 1984 I started my programming career with Whitesmith Pascal, > >Sorry for the off-topic post, folks, but this just opened a w

Re: [fpc-pascal] Be careful of too many features

2022-05-30 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Tue, 31 May 2022 08:39:20 +0700 >> On May 31, 2022, at 1:59 AM, Steve Litt via fpc-pascal >> wrote: >> >> The example code I've seen in the "Feature Announcement: Function >> References and Anonymous Functions" not o

Re: [fpc-pascal] Be careful of too many features

2022-05-30 Thread Steve Litt via fpc-pascal
Sven Barth via fpc-pascal said on Mon, 30 May 2022 23:25:52 +0200 >Steve Litt via fpc-pascal schrieb am >Mo., 30. Mai 2022, 21:25: > >> With the addition of callback functions, and the closures and events >> they bring to the table, you can go procedural, OOP, or to a de

Re: [fpc-pascal] Be careful of too many features

2022-05-30 Thread Steve Litt via fpc-pascal
Rainer Stratmann via fpc-pascal said on Mon, 30 May 2022 21:22:48 +0200 >Am Montag, 30. Mai 2022, 20:59:56 CEST schrieb Steve Litt via >fpc-pascal: >> I think adding yet more features obfuscates and Perlizes >> Pascal. > >What does Perlize mean? Perlize means to out

[fpc-pascal] Be careful of too many features

2022-05-30 Thread Steve Litt via fpc-pascal
Hi all, In 1984 I started my programming career with Whitesmith Pascal, and soon after Turbo Pascal 3, then C. C had the advantage of pointers to functions, Pascal had the advantages of better readability and less likelihood of errant pointers and buffer overruns. I did a little work with Object

Re: [fpc-pascal] alloca

2022-05-15 Thread Steve Litt via fpc-pascal
Hairy Pixels via fpc-pascal said on Fri, 13 May 2022 22:43:15 +0700 >Is there an “alloca" like function in the RTL which allocates memory >from the stack? For example >https://man7.org/linux/man-pages/man3/alloca.3.html Why not just allocate from the heap? Everything I've seen tells me that if