Re: [fpc-pascal] Trying to compile fpGUI on Win 11

2025-01-05 Thread James Richters via fpc-pascal
I just ran into this… After a lot of doodling around and eventually fixing it myself, I found it was already fixed years ago, but the fix never made it to the version on SourceForge. It’s been fixed in the GitHub version in the Maint branch Here’s the link: https://github.com/graemeg/fpGUI/tree/

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread James Richters via fpc-pascal
>And the same machine otherwise ? Yes everything is the same other than the version I am trying to compile with, and being run on the same system. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/l

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread James Richters via fpc-pascal
>Could it be due to a change of compilation mode (DELPHIUNICODE etc.) by the user? I haven't change any code at all but the unit that does the TProcess call is being compiled with: {$Mode TP}{$I-} {$modeswitch exceptions} {$R+} James ___ fpc-pascal mai

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread James Richters via fpc-pascal
I just tried compiling with the march version with -CpCOREI -OpCOREI -CfAVX2 -dMT and it worked as expected... so it's not the processor change that caused the issue. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freep

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread James Richters via fpc-pascal
>I assume that it is exactly the same source on exactly the same system with exactly the same compiler configuration. Well... you would think I would be compiling it the same way, but I'm not... I thought I was be when I went to verify that I found that I did make a change. I was compiling with:

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread James Richters via fpc-pascal
It does seem that '?' is being substituted in, but I don't know why, the ascii codes I am using are valid character they are: #$D0 - #$EF which are these: Þßàáâãäåæçèéêëìíîïï It's not like they are non-characters like escape or something. They are valid ascii characters. I went to the character m

[fpc-pascal] Is there a recent change to TProcess?

2024-12-19 Thread James Richters via fpc-pascal
I am using ProgProcess to execute a program with data passed as parameters. I'm adding the parameters with this: ProgProcess := TProcess.Create(nil); ProgProcess.Executable := 'cmd.exe'; ProgProcess.Parameters.Add('/c'); ProgProcess.Parameters.Add('start');

[fpc-pascal] fpGUI issue on current FPC trunk

2024-12-04 Thread James Richters via fpc-pascal
Hi Graeme, I'm not sure if you saw this issue as is was buried in the middle of one of my emails when you were out. I tried compiling fpGUI with the current FPC trunk (downloaded a few days ago) fpg_base.pas the line 38: TfpgChar= type String[4]; Gets this error: fpg_base.pas(41,32)

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread James Richters via fpc-pascal
I don’t know what causes this, but I have experienced the same issue. Just loading the IDE takes like 30 seconds on a version I installed in 2023 and another in early 2024, and those also compile much slower, but I just installed it again last week and the new version installed is fast again..

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

2024-12-01 Thread James Richters via fpc-pascal
been done in the develop branch. James -Original Message- From: fpc-pascal On Behalf Of Graeme Geldenhuys via fpc-pascal Sent: Sunday, December 1, 2024 3:51 PM To: fpc-pascal@lists.freepascal.org Cc: Graeme Geldenhuys Subject: Re: [fpc-pascal] What to do to get new users Hi James.

Re: [fpc-pascal] Printing unicode characters

2024-12-01 Thread James Richters via fpc-pascal
Indeed you CAN print Unicode characters, but not with the normal windows command prompt, nor with powershell, that is where the problem is, not with FreePascal. But if you go to the Windows Store and download the free “Windows Terminal” there you can get it to work. When you run the windows t

Re: [fpc-pascal] FPGUI on Windows

2024-11-30 Thread James Richters via fpc-pascal
ish I took the time to get it working sooner. It seems a lot easier than fiddling around with windows API calls. James -Original Message- From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Friday, November 29, 2024 4:58 PM To: 'FPC-Pascal users discussions'

[fpc-pascal] FPGUI on Windows

2024-11-29 Thread James Richters via fpc-pascal
Thought this should be a separate thread... sorry it if ends up confusing things. I'm trying to get FPGUI to work on Windows 10 with just FPC without Lazarus, and I'm just not having any luck. These seem to be three ways to install FPGUI on Windows. 1. Build it from a command line 2. Compile it

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

2024-11-28 Thread James Richters via fpc-pascal
>>That builds the whole GUI toolkit from the command line. Works on Windows, >>MacOS, Linux and FreeBSD. I'm intrigued by FPGUI, I'm trying to build FPGUI on Windows 10, and I'm having some difficulty. When I follow the instructions from Install.txt I get this: R:\fpgui_src_1.4.1\fpgui-1.4.1\s

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

2024-10-16 Thread James Richters via fpc-pascal
>> By and large, FPC (and Lazarus) is installed rather quickly. The only thing I wish for the installation of FPC is that all the help files were included and installed by default. I am always annoyed by being required to go get the help files and add them in myself when I install FPC. I th

Re: [fpc-pascal] PTCGraph resolution detection

2024-03-22 Thread James Richters via fpc-pascal
I found another way to get the screen resolution in Windows that is consistent between 32bit and 64bit programs using GetSystemMetrics. uses Windows; var ScreenWidth, ScreenHeight: Integer; begin ScreenWidth := GetSystemMetrics(SM_CXSCREEN); ScreenHeight := GetSystemMetrics(SM_CYSCREEN);

Re: [fpc-pascal] PTCGraph resolution detection

2024-03-20 Thread James Richters via fpc-pascal
>>No idea, but it does sound like a Windows issue to me. >>Or a video card driver issue? >>The API is the same. The mechanism for obtaining the list of resolutions is >>also the same. >>Perhaps Microsoft uses a fake DirectDraw shim in 64-bit Windows that presents >>a fake resolutions list, bec

[fpc-pascal] PTCGraph resolution detection

2024-03-19 Thread James Richters via fpc-pascal
I am trying to compile a program that uses PTCGraph for Windows 64 bit, and it's not behaving the same as it does on Win32. When I compile it for Win32, it is correctly detecting my monitor resolution I have a vertical monitor with a resolution of 1080x2560 When I run the Win32 program I correc

Re: [fpc-pascal] Floating point question

2024-02-22 Thread James Richters via fpc-pascal
I seem to recall there is some way to get 80 Bit Extended on 64 Bit Windows, but it involved compiling a 64bit version of FPC myself somehow, and I can't remember what it was all about, I'm pretty sure I was doing that for a while, but then I wanted to upgrade and couldn't remember how it was al

Re: [fpc-pascal] Floating point question

2024-02-20 Thread James Richters via fpc-pascal
>>If you're using Win64, then the answer is simple: x86_64-win64 unlike any other x86 target does not support Extended, so neither the compiler nor the code in runtime will ever calculate anything with that precision. To clarify, I am using i386-win32 on a 64 bit specifically because Extended is r

Re: [fpc-pascal] Floating point question

2024-02-19 Thread James Richters via fpc-pascal
>I would not put too much trust in Windows calculator, since there you have no control over the precision at all. The actual CORRECT answer according to https://www.wolframalpha.com/input?i=1%2F3.5 Is 0.285714 Repeating forever Which is what I get on windows only when using Variables. Var_Ans1

Re: [fpc-pascal] Floating point question

2024-02-19 Thread James Richters via fpc-pascal
>And if you have set the precision, then the calculation will be identical to >the calculation when you use a variable of the same type (if not, it's indeed >a bug). This is what I have been trying to point out. Math with identical casting with variables and constants are not the same. Maybe

Re: [fpc-pascal] Floating point question

2024-02-16 Thread James Richters via fpc-pascal
= 2.0010627116630224 Var_Ans1 = 2. When I do: Var_Ans1 := Win_Calc / (A_Var+B_Var/C_Var); Const_Ans1 := Win_Calc / (A_Const+B_Const/C_Const); -Original Message- From: fpc-pascal On Behalf Of Bernd Oppolzer via fpc-pascal Sent: Friday, February 16,

Re: [fpc-pascal] Floating point question

2024-02-16 Thread James Richters via fpc-pascal
>So you are saying when constant propagation is on, an expression should have a >different result than with constant propagation off? The result of math when using constants MUST be the same as the result of identical math using variables. There should never be a difference if I did my formula

Re: [fpc-pascal] Floating point question

2024-02-13 Thread James Richters via fpc-pascal
Ok, maybe this example will prove why it's not happening correctly: program Const_Vs_Var; Const A_const = Integer(8427); B_const = Byte(33); C_const = Single(1440.5); Win_Calc = 16854.045817424505380076362374176; Const_Ans = 16854.045817424505380076362374176 / (8427 + 33 / 1440.5);

Re: [fpc-pascal] Floating point question

2024-02-13 Thread James Richters via fpc-pascal
>As Jonas said, this would result in less efficient code, since all the math will then be done at full precision, which is slower. I don't think I'm explaining it well, I'm saying where there is an entire formula that the compiler needs to evaluate, what's happening now, is that each term is being

Re: [fpc-pascal] Floating point question

2024-02-13 Thread James Richters via fpc-pascal
Sorry for the kind of duplicate post, I submitted it yesterday morning and I thought it failed, so I re-did it and tried again.. then after that the original one showed up. A thought occurred to me. Since the complier math is expecting all the constants would be in full precision, then the co

Re: [fpc-pascal] Floating point question

2024-02-13 Thread James Richters via fpc-pascal
>>Overall, the intermediate float precision is a very difficult topic. I agree it's a difficult topic, it all comes down to what your program is doing, and whether you need performance or precision. >>And generate the slowest code possible on most platforms. I can appreciate the need to reduc

Re: [fpc-pascal] Floating point question

2024-02-13 Thread James Richters via fpc-pascal
It occurs to me that there is merit in reduction of precision to increase performance, and so I'm trying to learn how to do this correctly, but the thing that confuses me is that math with constants doesn't seem to be the same as math with variables, and I don't know why. It also looks to me like

Re: [fpc-pascal] Floating point question

2024-02-09 Thread James Richters via fpc-pascal
>However, adding support for an option called -CFMax or similar should be no problem. It would be VERY much appreciated! James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Floating point question

2024-02-09 Thread James Richters via fpc-pascal
>Because 1440.1 cannot be represented exactly as a single precision floating point number. Nor as a double or extended precision floating point >number for that matter, and in that case the compiler uses the maximum precision is supported by the target platform. I see that now, I think someone poi

Re: [fpc-pascal] Floating point question

2024-02-06 Thread James Richters via fpc-pascal
>IMO, the computations of AA+BB/CC (right hand side) should be carried out the >same way, regardless of the type >on the left hand side of the assignment. So I would expect the values in DD, >EE and FF being the same. In this example DD hold the value 8427.0224610 because DD it defined as a

Re: [fpc-pascal] Floating point question

2024-02-06 Thread James Richters via fpc-pascal
>Jonas has argued, not without reason, that calculating everything always at full precision has its disadvantages too. I agree with that, and I do see the value in reducing the precision when it is possible, but not when it's causing data loss. The intention is perfectly fine, it's the execution

Re: [fpc-pascal] Floating point question (Rafael Picanço)

2024-02-06 Thread James Richters via fpc-pascal
This is my opinion from my testing, but others may have something else to say. 1) Does it affects constants only? Not really, if you set a variable with constant terms, it is affected, if you set a variable with other variables, it is not affected. Cont Mycontant := 8432+33/1440.0;//Is a

Re: [fpc-pascal] Floating point question

2024-02-06 Thread James Richters via fpc-pascal
What's apparently happening now is: MyExtended := ReducePrecisionIfNoLossOfData (8246) + ReducePrecisionIfNoLossOfData (33.0) / ReducePrecisionIfNoLossOfData (1440.0); But it is not being done correctly, the 1440.0 is not being reduced all the way to an integer, because it was, everything would wor

Re: [fpc-pascal] Floating point question

2024-02-06 Thread James Richters via fpc-pascal
on would (and obviously did!) expect double precision throughout the calculation. Kind regards, Thomas - Original Message - From: James Richters To: 'FPC-Pascal users discussions' Sent: Tuesday, February 6, 2024, 13:44:37 Subject: [fpc-pascal] Floating point question I don'

Re: [fpc-pascal] Floating point question

2024-02-06 Thread James Richters via fpc-pascal
sions. I'm very thankful about the explanation. From the beginning, I knew that the error was on my side, but I didn't know *what* I'm doing wrong. Again, thanks for helping. Kind regards, Thomas - Original Message - From: James Richters via fpc-pascal To: 'FPC-P

[fpc-pascal] FW: Floating point question

2024-02-05 Thread James Richters via fpc-pascal
/view?usp=s haring James -Original Message- From: James Richters Sent: Monday, February 5, 2024 7:26 AM To: 'FPC-Pascal users discussions' Subject: RE: [fpc-pascal] Floating point question I ran this program in Borland Turbo Pascal 7.0 for DOS, and it does not have this pr

Re: [fpc-pascal] Floating point question

2024-02-05 Thread James Richters via fpc-pascal
166671634000 I expected them to be both the same. James -Original Message- From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Sunday, February 4, 2024 10:52 AM To: 'FPC-Pascal users discussions' Cc: James Richters Subject: Re: [fpc-pascal] Floating poi

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
I got the -CF argument to work... it's not just -CF, it's is -CF and then the limiting precision... -CF32 for single, or -CF64 for double, but it won't take -CF80 so Extended still doesn't come out right. With -CF64 I get better results but it's not completely doing it the old way. BB = 8427+3

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
, February 4, 2024 5:25 PM To: fpc-pascal@lists.freepascal.org Cc: Jonas Maebe Subject: Re: [fpc-pascal] Floating point question On 04/02/2024 23:21, James Richters via fpc-pascal wrote: > Shouldn’t this do all calculations as Extended? > > AA = Extended(8427+33/1440.0); No,

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
Shouldn’t this do all calculations as Extended? AA = Extended(8427+33/1440.0); It does NOT Const AA = Extended(8427+33/1440.0); BB = 8427+33/1440; CC = 8427.02291667; A_Ext = 8427.022460937500 B_Ext = 8427.022916625000 C_Ext = 8427.02291

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
>> Not specifying in a program, specially in a strict programming language like >> Pascal, will always result in implementation depending >> variations/assumptions. The problem is, I feel that I DID specify what should be by declaring my variable as Extended. And Apparently FPC agrees with m

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
Here is a more concise example that illustrates the issue. For me, being a human, I see 1440 and 1440.0 as exactly the same thing, but they are not acting as the same thing, and the 1440.0 is causing all the grief here. See how it makes a difference whether the .0 is there or not. Then replace t

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
>No need to yell. Yes, that's true, I apologize, I did not mean to come across that way. >This is how reasonable programing languages work. The result type depends only on the type of the involved variables/expressions. *Never* the variable it is assigned to. If it's never defined by the variab

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
cussions Cc: Florian Klämpfl Subject: Re: [fpc-pascal] Floating point question > Am 04.02.2024 um 13:50 schrieb Adriaan van Os via fpc-pascal > : > > Jonas Maebe via fpc-pascal wrote: >> On 03/02/2024 18:42, James Richters via fpc-pascal wrote: >>> Constants are also

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
How do I get -CF to work with the Text IDE? I put -CF and just CF in "Additional Compiler Args" either way I get: Error: Illegal parameter: -CF James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bi

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
I agree with Aadrian 100% "New behaviour: floating point constants are now considered to be of the lowest precision which doesn't cause data loss" We are getting data loss So it's doing it WRONG. So we are all living with a stupid way of doing things so some Delphi code won't have warning

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
fpc-pascal On Behalf Of Jonas Maebe via fpc-pascal Sent: Sunday, February 4, 2024 7:21 AM To: fpc-pascal@lists.freepascal.org Cc: Jonas Maebe Subject: Re: [fpc-pascal] Floating point question On 03/02/2024 18:42, James Richters via fpc-pascal wrote: > Constants are also evaluated wrong,you do

Re: [fpc-pascal] Floating point question

2024-02-04 Thread James Richters via fpc-pascal
I don't understand it either, the result of the 33/1440 is being stored in a single precision apparently, but it shouldn't be,. If TT is Double or Extended, then all parts of the evaluation of TT should be carried out in the same way, whether evaluated By the compiler or the program. That is wh

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

2024-01-07 Thread James Richters via fpc-pascal
>Try building with smartlinking, -XX I never knew there was an option for smartlinking. I'm using the FPC text IDE, I see various options like Generate Smaller Code, and level 1, 2, and 3 optimizations, but I don't see anything specifically called smartlinking. Is it the same as Generate Small

[fpc-pascal] Profiling in windows

2024-01-03 Thread James Richters via fpc-pascal
I have a freepascal project for Windows that works really well, but as soon as I start it, I have high CPU usage, and it stays high, it constantly uses 10% CPU while my program is running, even when it's idle waiting for me to make a selection from its menu. The main program loop does a few mi

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread James Richters via fpc-pascal
>Writeln() is special. You cannot duplicate it. That's good to know, I can stop trying. >What you can do is use WriteStr(), it has the same action as Writeln() but writes to a string instead of a file. I was hoping to just replace all existing Writeln()s with my procedure with a global search and

[fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread James Richters via fpc-pascal
I wanted to write what I thought should be a simple procedure, just instead of calling WRITELN() with some arguments, call WRITELOG() with the same arguments that you would use to write to a file, but my WRITELOG() procedure would write to the screen and the file.. but I can't figure out how to pa

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread James Richters via fpc-pascal
>3) There are some other smaller differences impacting compatibility with code designed to work with type shortstring (e.g. related to used character sets etc.). Here's a difference I discovered... I see that if I try to do something like: If MyString[1]='~' Then ... If MyString is an AnsiStri

[fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread James Richters via fpc-pascal
I keep getting bit by using STRING variables then trying to store more than 255 characters. My typical way to fix this is to just change it to an ANSISTRING. I'm wondering if there is any reason not to do this the other way around and just go through My entire program and replace all the STRING

Re: [fpc-pascal] case statement

2023-12-14 Thread James Richters via fpc-pascal
I have occasionally had ambiguity with ELSE, for example when you have IF statements nested inside other IF statements, sometimes the ELSE is seen as part of the inner, not the outer, or vice versa, depending on where the one-liners are but I just resolve it with some BEGIN - END Blocks, even if t

Re: [fpc-pascal] case statement

2023-12-14 Thread James Richters via fpc-pascal
I didn’t know there was such a thing as OTHERWISE. Is there any functional difference between OTHERWISE and ELSE? James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-27 Thread James Richters via fpc-pascal
I changed to Compiler Version 3.3.1-12875-gadf843196a which is what FPCUPDeluxe installed when I installed Trunk and now it runs just fine. So I guess there was a bug in 3.3.1-10077-gc8403ad49e that was fixed already. I was so convinced that I was doing something wrong I didn't even think to tr

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
Well that's worth a lot, it may be indicating a bug in 3.3.1? I guess I need to get on the current trunk to see if it's still misbehaving. James >Also, for what it's worth, your code works fine on fpc 3.20. ___ fpc-pascal maillist - fpc-pascal@list

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
I was using OleVarient and Varient. How can I check to see if CreateOleObject was successful? James >It sounds like " SpVoice := CreateOleObject('SAPI.SpVoice');" is failing and >then SpVoice is nil ? >May be try with an OleVariant instead of a simple Variant ? (i.e declare var >SpVoice: OleVar

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
When I run the code below I get: An unhandled exception occurred at $004143C0: ■ Free Pascal IDE Version 1.0.12 [2022/02/07] ■ Compiler Version 3.3.1-10077-gc8403ad49e ■ GDB Version GNU gdb (GDB) 7.2 Running "i:\programming\sapi.exe " EOleError: Variant does not reference an automation object $00

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
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 was still getting EOleError: Variant does not reference an automation object. Do I need to do all this Change FPU stuff?

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
I was trying to figure this out on my own.. I went to: https://wiki.freepascal.org/SAPI that is where I got my advice. I took the top example code from the link and made it into the following program: {$Mode OBJFPC} uses comobj; var SavedCW: Word; SpVoice: Variant; begin SpVoice := Creat

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread James Richters via fpc-pascal
I gave up on doing it directly, it seems SO convoluted to do with FPC with the COM unit and all this stuff I just don’t understand, and it’s SO simple to do with a VBS script in just 3 lines and it just works! (it would only be 2 lines if I didn’t want Microsoft Zira) So I decided to do this

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 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 try

[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] Size of set.

2023-05-23 Thread James Richters via fpc-pascal
>You can transverse a set with > for ... in Interesting, I learned something new, I did now know I could do this with FreePascal. It says it works for Strings and Arrays as well, does it also work for StringLists? James ___ fpc-pascal maillist

[fpc-pascal] Windows Display Settings

2023-05-13 Thread James Richters via fpc-pascal
Is there some way with FreePascal that I can Get / Set the windows display settings for multiple monitors like their resolutions, portrait/landscape, scale factors, and if they are disconnected or not? James ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] Pause Key

2023-04-16 Thread James Richters via fpc-pascal
It occurs to me that since Pause is independent of keypressed, I could actually us it as an extra modifier key if I wanted to... "Pause-A" could be different than "A", and also different than "CRTL-A" or "ALT-A", in fact I could do "Pause-CTRL-ALT-A" and have that be different than "CTRL-ALT-

Re: [fpc-pascal] Pause Key

2023-04-14 Thread James Richters via fpc-pascal
>> ... I wouldn't be surprised that James's program is a console one, not using TForm nor any windows message loop to process WM_ messages, but I may be wrong. Indeed you are correct, it is a very extensive console application which uses PTCGraph. I do accept keyboard input on both the Console w

[fpc-pascal] Pause Key

2023-04-13 Thread James Richters via fpc-pascal
Does anyone know what's up with the Pause key in Windows? Is there some way to tell if it was pushed? I have a need for the user to pause execution of my Freepascal program, I have a pause key.. seems like there should be some way to use it. James __

[fpc-pascal] Save and Restore Windows 10 Display configuration?

2023-04-03 Thread James Richters via fpc-pascal
Is there some way I can programmatically use FreePascal to save and Restore all the settings found in the Windows 10 Display settings such as the resolution and position of each monitor and if they are enabled or not? ___ fpc-pascal maillist - fpc-p

[fpc-pascal] For Loop with QWord

2023-01-03 Thread James Richters via fpc-pascal
I'm wondering why I can't have the following: Var I: QWord; Begin For I := 1 To N Do . It generates an error: Error: Ordinal expression expected If I change it to LongInt, then it works, but the question is, why can't I use a Qword here if I know I will never need I to be a negative nu

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

2022-12-30 Thread James Richters via fpc-pascal
I don’t know how my previous message got so out of sequence. I am not intending to continue this discussion, it was a message I sent early Thursday morning that was somehow delayed and is out of sequence. ___ fpc-pascal maillist - fpc-pascal@lists.fr

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

2022-12-30 Thread James Richters via fpc-pascal
>Assuming people in that sentence, you are referring to people who use write >programs or scripts which make use of databases, if you know very little about >the subject of databases on that subject, how can you justify this assertion? The ‘People’ I was referring to are any people who work wit

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

2022-12-29 Thread James Richters via fpc-pascal
>Well, this discussion has not gone well at all! I agree >I suggest that everyone relax and discontinue pursuing it. I apologize to Anthony and everyone on the list for getting too carried away. James ___ fpc-pascal maillist - fpc-pascal@lists.free

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

2022-12-29 Thread James Richters via fpc-pascal
>It shouldn't be confusing to anyone who has been programming for decades. It is very confusing if you never had a need for any kind of database.. which I do not…. And neither do many other programmers. Databases are only a very small part of what people use computers for, and only a very small

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

2022-12-29 Thread James Richters via fpc-pascal
“James, when you raised these questions are you saying that you don't know, or that someone who doesn't know much if anything about programming doesn't know” The point I was trying to make is that most of this is gobbely gook to me. So I went looking for something I could recognize.. and I sa

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

2022-12-28 Thread James Richters via fpc-pascal
>i think he meant both... Yes I meant both, I myself as an experience programmer cannot follow really any of what is going on at all.. except the button that clears the message box. I can't figure out why there is a timer, I can't figure out how you would change the amount of time being timed, or

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

2022-12-27 Thread James Richters via fpc-pascal
>>If the target audience are people that are not yet into programming, I think the code samples might be a little too difficult ? I have been programming with Pascal since the days of Turbo Pascal, I have applications with hundreds of thousands of lines of code, and I also program C++ and Python,

Re: [fpc-pascal] Program efficiency

2022-11-09 Thread James Richters via fpc-pascal
Sounds to me that if the compiler will probably insert temp variables anyway, then I might as well make my own and make it easier to understand later. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-b

[fpc-pascal] Program efficiency

2022-11-09 Thread James Richters via fpc-pascal
I was wondering if breaking up large complicated formulas into smaller sections that use more variables is less efficient than just the large formula. In other words.. is A:=(B+C/D)-E^F; G:=H*(I+J); K:=L+M/N; O:= A+G-K; Less efficient than O:= ((B+C/D)-E^F)+ (H*(I+J))-(L+M/N); Or does it end up

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

2022-09-22 Thread James Richters via fpc-pascal
al 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 with long file names That's on windows, you said the pro

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

2022-09-22 Thread James Richters via fpc-pascal
:16 PM, Jean SUZINEAU via fpc-pascal wrote: May be by escaping the spaces with ^ ? Something like: MyFileName:= StringReplace(MyFileName, ' ', '^ ', [rfReplaceAll]); ^ is the escape char for cmd.exe but may be it is active in this context too ? Le 20/09/2022 à 18:31, James Rich

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

2022-09-20 Thread James Richters via fpc-pascal
0, 0); I'm still trying to see if there is a way to close everything even if I don't know the alias anymore. James -----Original Message- From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Tuesday, September 20, 2022 5:21 PM To: 'FPC-Pascal users discussions

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

2022-09-20 Thread James Richters via fpc-pascal
That Alias method does seem to work.. thank you for the suggestion, although it makes it more complicated for asynchronous operation, which is of course what I wanted. So here is what I came up with.. for synchronous operation, this works fine: mciSendString(Pchar(Ansistring('Open ' + #34+MyLong

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

2022-09-20 Thread James Richters via fpc-pascal
I just figured out that short filenames won't work, my files are on a linux server... not NTFS drives.. so I'm back to getting it to work with spaces the normal file names James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.fr

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

2022-09-20 Thread James Richters via fpc-pascal
I just tried it that way: Var pcmd: String; MyFileName: String; pcmd:='play "'+MyFileName+'"'+#0; mciSendString(@pcmd[1],Nil,0,0); I get the same results, files with no spaces in the name even long file names play fine, if there's spaces, they won't play. I had the idea to just get the wind

[fpc-pascal] mciSendString with long file names

2022-09-20 Thread James Richters via fpc-pascal
I'm trying to get mciSendString() to work with long file names with spaces in them and I'm not having any success. I know with winnows you need quotes around long file names, so I'm trying things like this: Var MySoundFile:String; mciSendString(PChar('play '+Ansistring(#34+MySoundFile+#34)),Nil,0

[fpc-pascal] SerReadTimeout question

2022-09-18 Thread James Richters via fpc-pascal
I can't seem to find any documentation or SerRead or SerReadTimeout.. searching for either along with Freepascal doesn't get me any results. If it exists somewhere and I am just missing it, can someone tell me where it is? Anyway, what I'm trying to figure out is when the timeout timer starts...

Re: [fpc-pascal] Getting Shift key with PTCCRT

2022-09-18 Thread James Richters via fpc-pascal
I came up with a solution for this. Since I am on windows, I found I can just check GetAsyncKeyState between keypressed and readkey like this: If PTCCRT.KeyPressed then Begin isShiftDown := GetAsyncKeyState(VK_Shift); MyKey:=PTCCRT.ReadKey;

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

2022-09-12 Thread James Richters via fpc-pascal
So I could just do this? Index:= MyStringlist.IndexOfName(SearchName); If Index >=0 then MyValue := MyStringlist[Index].ValueFromIndex; That sure is nice to know, Thank you! I guess for my dynamic arrays of records, I still need to search with a loop... or is there a cool thing I don't kn

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

2022-09-12 Thread James Richters via fpc-pascal
The problem with the for in loop is that I need the index. I'm sometimes searching through the stringlist looking for a match, and when I find a match, I want to read the value And then do a break, because there is no point is searching once I found what I am looking for: For I:= 0 to MyStringl

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

2022-09-11 Thread James Richters via fpc-pascal
The loops is just an example because in my original post of why I wanted to get the highest element of a stringlist was because I wanted a for loop that wasn't as clumsy as For I:=0 to myStringlist.count-1 Do This came up because thanks to this discussion list, I learned I could use High() and Lo

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

2022-09-10 Thread James Richters via fpc-pascal
Thank you for the example! I also needed {$Mode OBJFPC} to get it working. I am normally in {$Mode FPC} Or {$Mode TP} But I found that if I just put this in a unit that is {$Mode OBJFPC} and include that unit in my {$Mode TP} Unit it works just great! I have a useless unit that is just a who

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

2022-09-10 Thread James Richters via fpc-pascal
This Helper sounds like a nice way to do it. I need the numerical index of the loop so this would be more straight forward. Would I then do something like : For I:= 0 to MyStringList.High Do ? When I try to add the Type statement: type TStringListHelper = class helper for TStringList function Hi

[fpc-pascal] Get highest element of a StringList

2022-09-10 Thread James Richters via fpc-pascal
I thought I would try: For Loop := 0 to High(MyStringList) do But I get "Error: Type mismatch" Is there a way to get the highest element of a stringlist other than: For Loop := 0 to MyStringList.Count-1 do It would be nice to not have the -1 Could High() be made to work if the argument was a s

Re: [fpc-pascal] Getting Shift key with PTCCRT

2022-09-10 Thread James Richters via fpc-pascal
Thanks for the suggestion I think the syntax should be: type myKeyEvent = IPTCKeyEvent; Var myShiftStatus : boolean; myShiftStatus := myKeyEvent.Shift; but I get IPTCKeyEvent not found. I wonder if it's only designated as internal.. or if I need to use something other than PTCGraph and PTCCRT

  1   2   3   4   5   6   7   >