Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
Thanks for the help, it's working fine using readinteger I guess as long as I don't have any values large enough to need the most significant digit that would work... In order to change the value I want to change, I need to run my program as administrator, is there a way to change to

Re: [fpc-pascal] Remove last character from pchar

2021-06-10 Thread James Richters via fpc-pascal
Pchars are just a pain, I do not use any Pchars.. instead I use AnsiStrings that I can manipulate in a way that is easy and then I just do Pchar(myvariable) whenever I need to use a function that needs a Pchar… like this: Var MessageBoxText:Ansistring; .. ..

Re: [fpc-pascal] Remove last character from pchar

2021-06-10 Thread James Richters via fpc-pascal
Also StrPCopy will take the contents of an existing PChar and put it in an AnsiString… And sometimes I have regular pascal strings I want to pass to something as a Pchar, so then I do: Pchar(AnsiString(mystring)); But lately I’ve been just making all strings AnsiStrings anyway. James

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-18 Thread James Richters via fpc-pascal
>MAX_PATH itself seems to be an alias from system unit where it is defined accordingly to the operating system (260 on windows, 4096 on Linux, 1024 on BSD, Solaris and Darwin). >It's unlikely, but this way you can end up with the corruption of the byte right after the memory block DefaultFileName

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread James Richters via fpc-pascal
Do a Ping to an address on the network to see if it's connected? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-21 Thread James Richters via fpc-pascal
>It's curious, I'm not completely sure we are reasoning about the same function and record. It seems I should not be using TFilename as the variable name. I'm usinga variable called TFileName with GetSaveFileNameA() Here is the relevant code.. after I fixed it to use Max_Path Uses

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-21 Thread James Richters via fpc-pascal
I have it working better now. I was having a crash with Code 216 Appearantly SaveAsFileName.lpstrFile:= Pchar(DefaulSaveAsFileName); Just doesn't work the way I want it to. If I try to do the conversion to Pchar that way, I get an error 216 on:

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-21 Thread James Richters via fpc-pascal
>I would prefer to use > StrPLCopy( SaveAsFileNameBuffer, DefaulSaveAsFileName, SizeOf(SaveAsFileNameBuffer)); >instead of >  SaveAsFileNameBuffer:=Pchar(DefaulSaveAsFileName); I'm curious what the difference is between StrPLCopy() and PChar() I wonder if PChar() was my problem.. maybe I don't

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-21 Thread James Richters via fpc-pascal
>It's best to think of these in two parts. The Windows API part and then the >interfacing with Pascal part. >SaveAsFileName.lpstrFile = long pointer to a (C) string filename buffer >This buffer isn't created for you, you provide it and tell Windows it's size. Thank you for the explanation, that

[fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
Is there documentation for TRegistry somewhere? I've been searching for information on it, and so far I've only been able to find: https://wiki.freepascal.org/fcl-registry and http://docwiki.appmethod.com/appmethod/1.17/codeexamples/en/TRegistry_(Objec t_Pascal) They kind of get me started

Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
I'm not using Lazarus. I guess I can try to make a sample program with it just to see what the options are. It seems like there should be a ReadDword, and ReadQword because there are an awful lot of Dword and Qword types in the registry. James ___

[fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-18 Thread James Richters via fpc-pascal
I'm using GetSaveFileNameA() in a windows console program to obtain a save-as directory and file name, I am passing sending it a default file name with: TFileName.lpstrFile:=Pchar(DefaultFileName); DefaultFileName is an AnsiString that contains a full path and filename. This all works fine

Re: [fpc-pascal] GetSaveFileNameA limited to 100 characters in default name

2021-06-18 Thread James Richters via fpc-pascal
I'm converting my AnsiString to a Pchar with TFileName.lpstrFile:=Pchar(DefaultFileName); But I didn't understand the meaning of TFileName.nMaxFile:=100; I thought it was the maximum number of files to display or something.. not the maximum number of characters in the file name. which it

Re: [fpc-pascal] Directory Tree

2021-05-13 Thread James Richters via fpc-pascal
>I have split the unit uEXE_INI (subdirectory pascal_o_r_mapping/02_Units ) and >moved the code causing the creation of this entry in a new unit >uEXE_INI_Global. Thank you, it is not creating this other file anymore. James ___ fpc-pascal maillist -

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

2021-05-19 Thread James Richters via fpc-pascal
> So now I am down to the timers... > I am using TFPTimer timers in the scheduler to handle various things, > some of them are just one-shots to delay an action for some predetarmined > time. I don't know how TFpTimers work either, but when I want a timer in one of my console apps, I just do

Re: [fpc-pascal] Detecting IO errors with INI file

2021-04-29 Thread James Richters via fpc-pascal
Thanks everyone for the help. I have it working now I did some more searching and found out I can get "Try" to work with {$Mode TP} If I add {$Modeswitch exceptions} and appearantly {$R+} to make sure range checking is on. So I have it working in my {$Mode TP} Unit.

Re: [fpc-pascal] Directory Tree

2021-05-01 Thread James Richters via fpc-pascal
I’ve been trying to save more things to the configuration.ini file, I’ve managed to save my Load Time Variable… I was just trying to change SessionProperties myself, but it wouldn’t work if I tried that.. but if I used object inspector and click ed on SessionProperties and added it to the list

Re: [fpc-pascal] Directory Tree

2021-05-02 Thread James Richters via fpc-pascal
>>Any ideas how to save and restore the column widths for VirtualStrinTrees in >>the ini file? > Done with the events and methods of TIniPropStorage. Thanks, I see how that works now. I see you cleaned it all up and made pull down menus. For some reason, the timer isn’t delaying

Re: [fpc-pascal] Directory Tree

2021-05-02 Thread James Richters via fpc-pascal
hange(Sender: TObject); begin If Not(tFirst.Enabled) Then Load_from_File; end; James From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Sunday, May 2, 2021 9:14 AM To: 'FPC-Pascal users discussions' Cc: James Richters ; 'Jean SUZINEAU' Subject: Re: [fpc-pascal] Di

Re: [fpc-pascal] Directory Tree

2021-05-02 Thread James Richters via fpc-pascal
I’ve been making progress with learning how to make some modifications myself to this project, I’ve been pushing them to Github. I added a custom report title, I have if functioning the way I want it to.. just pulling the report title from the INI file and saving it in a variable, then

[fpc-pascal] Detecting IO errors with INI file

2021-04-28 Thread James Richters via fpc-pascal
I'm trying to detect if an INI file is open by another program, but the way I normally do this is not working. // open the file for write and keep it open to test Assign(myfile,'my.ini'); Rewrite(myfile); {$i-} Assign(myfile2, 'my.ini'; Rewrite(myfile2);//try to open it for write again

Re: [fpc-pascal] Detecting IO errors with INI file

2021-04-29 Thread James Richters via fpc-pascal
I get Error: Identifier not found “Try” Because my unit must be compiled with {$MODE TP} Otherwise quite a few procedures and functions won’t even compile that only work in Turbo Pascal mode. I guess I can put it in another unit and make a call to that… then I can use Try Thanks for the

Re: [fpc-pascal] Detecting IO errors with INI file

2021-04-29 Thread James Richters via fpc-pascal
I’m trying to put the Ini file stuff all in it’s own unit. My unit is {$Mode OBJFPC} and Uses IniFiles; “Try” is compiling, but I’m getting Error: Identifier not found “EFOpenError” And also Syntax error “Do” expected but “)” found I have: try Log_ini := TIniFile.Create('myini.ini');

Re: [fpc-pascal] Detecting IO errors with INI file

2021-04-29 Thread James Richters via fpc-pascal
>Best add SysUtils and Classes. Thanks, that worked. But now I'm getting "cannot read or write variables of this type" for Writeln(Exception) is there an easy way to find out what the exception is? James ___ fpc-pascal maillist -

Re: [fpc-pascal] Directory Tree

2021-04-25 Thread James Richters via fpc-pascal
-pascal On Behalf Of Jean SUZINEAU via fpc-pascal Sent: Saturday, April 24, 2021 9:39 AM To: fpc-pascal@lists.freepascal.org Cc: Jean SUZINEAU Subject: Re: [fpc-pascal] Directory Tree Le 23/04/2021 à 19:56, James Richters via fpc-pascal a écrit : Get Checked or Selected works great, but if I push

Re: [fpc-pascal] Directory Tree

2021-04-24 Thread James Richters via fpc-pascal
I’ve been trying make “Load from file” happen automatically when the program starts.. I would like it to happen after configuration.ini restores the file name and also after the form is on the screen so I can see the load bargraph. I tried putting it in Panel1 OnEnter but the form doesn’t

Re: [fpc-pascal] Directory Tree

2021-04-25 Thread James Richters via fpc-pascal
I fixed the time totals to show days correctly with this: procedure TTreeData.SetdValue( _dValue: TDateTime); begin FdValue:= _dValue; FValue:=''; If FdValue>=2 Then FValue:= Format ('%d Days ',[Trunc(FdValue)]) Else If FdValue>=1 Then FValue:= Format ('%d Day

Re: [fpc-pascal] Directory Tree

2021-04-24 Thread James Richters via fpc-pascal
, James Richters via fpc-pascal a écrit : Now if I type new text in the ODT document, it’s Consolas, but the actual text in the document is still Liberation Serif… and it doesn’t align, if I select all the text and change it to Consolas it’s fine.. I tried making a new template with Word I get

Re: [fpc-pascal] Directory Tree

2021-04-25 Thread James Richters via fpc-pascal
>I'll try another pull request of something simple just to see if it will work. I made another pull request on GitHub, https://github.com/jsuzineau/pascal_o_r_mapping/pull/3 This one is an attempt to add some text boxes and to use them to display the totals and to get a time variable

Re: [fpc-pascal] Directory Tree

2021-04-25 Thread James Richters via fpc-pascal
Thanks for the explanation... phew, what a lot of stuff... no wonder I like my console programs so much  For critical timing applications I have a lot more control of exactly when things happen... but this project is helping me appreciate the benefits of a GUI application. I just need to

Re: [fpc-pascal] Directory Tree

2021-04-25 Thread James Richters via fpc-pascal
>I added LoadFromFile in this event. That was the first thing I tried, but the problem is, this happens before anything is put on the screen.. so when I run the program with an Ini file with 4000 entries in it, there is a good 30 second delay, and then the screen is shown with

Re: [fpc-pascal] Directory Tree

2021-05-03 Thread James Richters via fpc-pascal
Thanks for the explanation of classes. I didn’t realize I ended up making it so big, I was trying to keep it able to fit on a 1280 x 1024 screen.. I guess 1280x1024 is less of a percentage of my 4K screen than I thought. The 2 rows is much nicer. Some of my machine times and run times get

Re: [fpc-pascal] Directory Tree

2021-05-03 Thread James Richters via fpc-pascal
>Just for notice: classes and objects are not particular to Lazarus, it's plain >Object Pascal, understood by Freepascal and Delphi whatever the context( >console, graphic/Lazarus or javascript/pas2js) I have some classes and objects in my console programs, but they are there to get some new

[fpc-pascal] Directory Tree

2021-04-06 Thread James Richters via fpc-pascal
Does FPC include any tools to display a directory tree, similar to the way files and folders are normally displayed, but I want to make my own custom entries. Have the branches expand and collapse etc.. It doesn't have to be graphical, it can be text based. Or Am I going to be better off going

[fpc-pascal] Formatting Question

2021-04-03 Thread James Richters via fpc-pascal
I'm looking for a way to format numerical data in a string so that everything ends up aligned by the decimal point. I've been trying to use the Format() function but I don't see how to do what I am looking for... then again I don't really understand the format() function, and most of the

Re: [fpc-pascal] Formatting Question

2021-04-04 Thread James Richters via fpc-pascal
That looks almost perfect.. can I suppress the trailing zeros with the format command without losing the alignment? James Richters <http://www.productionautomation.net> www.productionautomation.net <mailto:ja...@productionautomation.net> ja...@productionau

Re: [fpc-pascal] Formatting Question

2021-04-04 Thread James Richters via fpc-pascal
0.5 2.53 12.5 Thanks! That’s exactly that I was looking for. Thank you for sharing your code! James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Directory Tree

2021-04-06 Thread James Richters via fpc-pascal
Is there any documentation or a sample program for TDirListBox? I tried doing a search but only found a page that showed it's functions and procedures, but no real explanation on what they are supposed to do. James >FPC package FV (FreeVision) contains an object TDirListBox which allows

Re: [fpc-pascal] Directory Tree

2021-04-06 Thread James Richters via fpc-pascal
I'm developing a new application where the user will need to select items from a tree structure.. I'm trying to figure out how to do the tree at all, and allow the user to select multiple files and/or folders. If the tree is going to be too complicated in text mode, then maybe I'll have to

Re: [fpc-pascal] Directory Tree

2021-04-07 Thread James Richters via fpc-pascal
in way to load a data file that somehow designates the hierarchical order. James -Original Message- From: fpc-pascal On Behalf Of James Richters via fpc-pascal Sent: Tuesday, April 6, 2021 1:13 PM To: 'FPC-Pascal users discussions' Cc: James Richters ; 'Jean SUZINEAU' Subject: Re

Re: [fpc-pascal] Directory Tree

2021-04-15 Thread James Richters via fpc-pascal
>I finally found on my linux machine a 'test_gICAPI\jsLignes.Exclus.txt' >... >It should work for you now. I've tested several time checking out the whole >repository and switching to the TjsDataContexe branch It does work, but not perfectly. I'm using GitKracken and Github desktop. I am able

Re: [fpc-pascal] Directory Tree

2021-04-15 Thread James Richters via fpc-pascal
Thanks for the explanations and fixing your sample program. I thought there would probably be an easy way to save settings in an Ini File >>Is there a way to export the file list and the second TVirtualStringTree to a >>PDF file? >As far as I know, there is no way to directly export it. I will

Re: [fpc-pascal] Directory Tree

2021-04-10 Thread James Richters via fpc-pascal
Jean, Thank you very much for the example! That gives me a great start and I really appreciate the effort you put in. Thanks for re-sending it, the first one never came though. I was able to replace the sample INI file with some of the real data and it all came in very nicely! I'm curious

Re: [fpc-pascal] Directory Tree

2021-04-19 Thread James Richters via fpc-pascal
I updated Lazarus to Lazarus 2.0.12 / fpc 3.2.0 and that indeed did fix the default encoding error. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Directory Tree

2021-04-13 Thread James Richters via fpc-pascal
I tried to make a fork of your repository but I could not change off the master branch,, I always get an error: Checkout Failed Cannot checkout to invalid path 'tools/text_glCAPI\jsLignes.Exclus.txt' I suspect the / in the path is the problem because I am on Windows and it can only use \ for

Re: [fpc-pascal] Directory Tree

2021-04-14 Thread James Richters via fpc-pascal
>I've removed this file. I work both with Linux and Windows, most of the time >it's ok I still can’t get off the Master branch on my windows machine. I deleted everything, re-forked it, re-cloned it, and I still can’t check out any branch other than Master… It’s not that

Re: [fpc-pascal] Directory Tree

2021-04-17 Thread James Richters via fpc-pascal
ideas how to get box characters to work? James -Original Message- From: fpc-pascal On Behalf Of Jean SUZINEAU via fpc-pascal Sent: Friday, April 16, 2021 6:23 PM To: fpc-pascal@lists.freepascal.org Cc: Jean SUZINEAU Subject: Re: [fpc-pascal] Directory Tree Le 15/04/2021 à 20:16, James

Re: [fpc-pascal] Directory Tree

2021-04-18 Thread James Richters via fpc-pascal
Thanks for figuring that out. I get uFileVirtualTree.pas(533,9) Error: identifier idents no member "DefaultEncoding" For line:sl.DefaultEncoding:= TEncoding.GetEncoding(850); If I just comment out that line, it works fine for me, because I'm codepage 850 anyway, but that doesn't help

Re: [fpc-pascal] Directory Tree

2021-04-18 Thread James Richters via fpc-pascal
>I use currently Lazarus 2.0.12 / fpc 3.2.0. I have Lazarus 2.04 / fpc 3.04 I have fpc 3.2.0 in another directory. It should be easy enough for me to re-install Lazarus. Thanks for figuring that out! >I have corrected this point, it should work now. Yes it looks fixed even in my large data

Re: [fpc-pascal] Directory Tree

2021-04-08 Thread James Richters via fpc-pascal
The data I'm trying to display in the tree is a list of filename, but they aren't the names of the files on the disk, they are modified to include the time they take to run on a CNC machine. What I have is an INI file with a list like this: [Files] M:\Project1\File1=8:32 M:\Project1\File2=7:43

Re: [fpc-pascal] Directory Tree

2021-04-11 Thread James Richters via fpc-pascal
I had a feeling it wouldn't be easy to change, but thought I would ask. I like the selected items to be highlighted as they are in your TTreeview example. I'm confused by your reference to slFiles.Names and slFiles.ValueFromIndex I am trying to see how those got defined. I see slFiles is a

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

2021-02-12 Thread James Richters via fpc-pascal
The problem I have had is when programs I compile generate a false virus detection.. sure on my own computer I can just disable that directory from the virus scanner but it becomes a problem when I release it to my customers and their virus scanners quarantine it. I have no idea how to

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

2021-02-12 Thread James Richters via fpc-pascal
How does one sign an executable? From: fpc-pascal On Behalf Of Dmitry Boyarintsev via fpc-pascal Sent: Friday, February 12, 2021 4:28 PM To: FPC-Pascal users discussions Cc: Dmitry Boyarintsev Subject: Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program Are signed

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread James Richters via fpc-pascal
I've been using a lot of dynamic arrays of records lately, Some are even Dynamic Arrays of records that contain other records, for example: Type XYZ_Record = Record X,Y,Z : Double End; Call_Stack_Record = Record Location : LongInt; Offset : XYZ_Record;

Re: [fpc-pascal] Directory Tree

2021-04-22 Thread James Richters via fpc-pascal
For some reason the ODT file wants to know if I want to translate it from French, and while the font is “Courier New” for anything I would type into the document, the font of the text itself is “Liberation Serif” If I change the font manually to “Courier New” I get gaps in the vertical lines,

Re: [fpc-pascal] Directory Tree

2021-04-22 Thread James Richters via fpc-pascal
>But I've included the source code from this project and modified the code to >produce the pdf. >I've had trouble with the fonts but it seems to works reasonably well with >DejaVuSans. >It's not the ideal font, but box characters are displayed relatively correctly. >I'm not 100% sure it will

Re: [fpc-pascal] Directory Tree

2021-04-23 Thread James Richters via fpc-pascal
Now if I type new text in the ODT document, it’s Consolas, but the actual text in the document is still Liberation Serif… and it doesn’t align, if I select all the text and change it to Consolas it’s fine.. I tried making a new template with Word I get a warning that some things won’t be saved

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

2021-09-01 Thread James Richters via fpc-pascal
>I guess I should just use lazarus and learn the GUI Tools. I was having a >problem when i was following the one of the books on the FP book wiki > , where i went to compile my program, and the IDE threw an error about an .o > file not found. As others have mentioned, you can write console

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

2021-08-29 Thread James Richters via fpc-pascal
I write almost all console programs with FreePascal and also use the Freepascal IDE a lot. It is compatible with Turbo Pascal and that is what I learned to program with … because it was modern at the time  So turbo pascal books are a good way to learn Pascal in general, as I had no problem

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

2021-09-10 Thread James Richters via fpc-pascal
Well, that sure is a lot simpler than parsing the IPConfig output! Is there a way to capture the MAC address this way as well? uses {$IFDEF MSWINDOWS}Windows, WinSock,{$ENDIF} Should have a ; at the end instead of a , uses {$IFDEF MSWINDOWS}Windows, WinSock;{$ENDIF} James

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

2021-09-10 Thread James Richters via fpc-pascal
>You can use the ipconfig command and parse its output (especially ipconfig >/all). Here’s how I use ipconfig and parse the output: https://gist.github.com/Zaaphod/d1b7bf7a29aa653e3b0b61a836a03f62 James ___ fpc-pascal maillist -

Re: [fpc-pascal] Why the difference in the rounded results?

2021-10-15 Thread James Richters via fpc-pascal
The difference is because of the way floating point math works.. and how rounding works. Rounding something that ends with 5 is ambiguous, because it could round up, or it could round down... You can control the behavior of rounding with SetRoundMode(); See

Re: [fpc-pascal] {$include %dateyear%}

2021-12-24 Thread James Richters via fpc-pascal
I would agree that the documentation actually states quite clearly that they are ALL strings except %linenum% and the documentation should be improved to be accurate. Perhaps {$INCLUDE %XXX%} the {$INCLUDE} directive inserts a string or integer constant in the source code. Here XXX can be

Re: [fpc-pascal] {$include %dateyear%}

2021-12-25 Thread James Richters via fpc-pascal
I see what you mean... I thought it was an Integer because If you do something like: Writeln({$I %DATEMONTH%}+'/'+{$I %DATEDAY%}+'/'+{$I %DATEYEAR%}); You get Error: Operator is not overloaded: "ShortInt" + "Char" But that's not what it is it's just like typing in hard coded numbers

Re: [fpc-pascal] {$include %dateyear%}

2021-12-26 Thread James Richters via fpc-pascal
I can put some more thought into it.. but I'm wondering how to properly submit a change request for this documentation. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Backtrace

2022-01-04 Thread James Richters via fpc-pascal
To: fpc-pascal@lists.freepascal.org Cc: Graeme Geldenhuys Subject: Re: [fpc-pascal] FPC Backtrace On 2022-01-03 23:45, Graeme Geldenhuys wrote: > On 2022-01-03 13:28, James Richters via fpc-pascal wrote: >> I’m curious if there is some way, perhaps with some directive or >> something t

[fpc-pascal] FPC Backtrace

2022-01-03 Thread James Richters via fpc-pascal
I'm curious if there is some way, perhaps with some directive or something to force a debug backtrace to happen, but without an error. I have a function that is getting called twice and should only be called once, so my thought is that if I could go into the routine and put something there that

Re: [fpc-pascal] FPC Backtrace

2022-01-03 Thread James Richters via fpc-pascal
That works great!!! Exactly what I was wanting Thank you, James On Mon, Jan 3, 2022 at 3:28 PM James Richters via fpc-pascal mailto:fpc-pascal@lists.freepascal.org> > wrote: I’m curious if there is some way, perhaps with some directive or something to force a debug backtrace to

[fpc-pascal] Keeping current with FPC Source on gitlab

2021-11-05 Thread James Richters via fpc-pascal
I'm trying to set things up so I can stay up to date with the latest FPC sources on gitlab. I'm following the instructions found here: https://www.freepascal.org/develop.var - Connect to Source Repository with Git So I have cloned the read only sources, and now I have the FPC directory

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

2021-12-05 Thread James Richters via fpc-pascal
Indeed keeping it a DWord solves all the problems for any amount of time less than the 49.7 day rollover time and I don't even have to check for the rollover because it takes care of itself by doing unsigned arithmetic. Is there even such a thing as overflow checking for DWord variables? I did

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

2021-12-05 Thread James Richters via fpc-pascal
Thanks for the explanation. This works the way I want it to... working with the rollover without causing an overflow error even if I leave overflow checking turned on. DWord((QWord(GetTickCount) - QWord(Last_Input_Info.dwTime)) AND $) James

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

2021-12-05 Thread James Richters via fpc-pascal
Oh I see.. it does work on DWord.. I was testing it with constants: Writeln($FFFE+$0006); But I think the compiler resolved this so it would never create a overflow error.. When I do it with variables now I get the overflow and I can control it with {$Q-} and {$Q+} Is there some way I

[fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread James Richters via fpc-pascal
I'm trying to get the time lapsed since the last user input with keyboard or mouse on a Windows PC. For this I am doing: GetLastInputInfo(Last_Input_Info); IdleTime:= (GetTickCount - Last_Input_Info.dwTime) DIV 1000; This works most of the time, but every 25 days or so GetTickCount rolls over,

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread James Richters via fpc-pascal
A new function that works with other types of strings would simply need to be called something else, and not use the val function at all then it would interfere with nothing. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread James Richters via fpc-pascal
I don’t see what the problem with a shortstring buffer is.. strtoint could not make use of an input string longer than 256 characters anyway, because the output integer could not have more than 19 digits anyway.. so an input string longer than this would be useless… just convert to a

[fpc-pascal] Windows Volume Control

2022-01-15 Thread James Richters via fpc-pascal
Are there functions to check the current volume level and to set the volume with just FPC (not Lazarus) on Windows 10? All I need is the master system volume, not any of the mixer controls. James ___ fpc-pascal maillist -

[fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-14 Thread James Richters via fpc-pascal
Is there a quick way to sort a stringlist on it's .ValueFromIndex field instead of it's .Names field? James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-15 Thread James Richters via fpc-pascal
Thanks for the elegant solution Michael, but I'm having some issues implementing it. I'm getting: pastep.pas(28651,10) Warning: Function result does not seem to be set 28650 // Custom compare function 28651 function CompareValues(List: TStringList; Index1, Index2: Integer): Integer; 28652

Re: [fpc-pascal] PTCGraph window location

2022-03-13 Thread James Richters via fpc-pascal
-pascal@lists.freepascal.org Cc: Nikolay Nikolov Subject: Re: [fpc-pascal] PTCGraph window location On 3/12/22 15:54, James Richters via fpc-pascal wrote: Is there some way I can set the location of the pctgraph window before it is created so it just pops up where I want it to be? I’m using

[fpc-pascal] PTCGraph window location

2022-03-12 Thread James Richters via fpc-pascal
Is there some way I can set the location of the pctgraph window before it is created so it just pops up where I want it to be? I'm using Windows 10. I've been re-locating it with SetWindowPos() which is ok if the window is going to be open for a while, but now I am trying to make a little

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread James Richters via fpc-pascal
Thanks for the link and the work around idea. I really don't know what settings I had for the CSV file, I just clicked Save-As and changed it to CSV... I didn't even know there was an ASCII option. The newer versions of Excel make you jump though hoops just to see where on your hard drive you

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread James Richters via fpc-pascal
>I have fixed this in trunk. I updated to the current trunk and indeed your fix has solved the issue... for excel files, however if I try it with a text file.. something that I type in from scratch with a text editor, it crashes with: Running "i:\programming\gcode\1d cut\1d.exe x:\text.CSV"

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread James Richters via fpc-pascal
>Strange, I have it here ? Maybe it was introduced later... Maybe I need to use another unit? >Notepad++ detects the BOM Marker but obviously does not show it. I even tried going to View and Show Symbol and Show All Characters in Notepadd ++ so I see all the CRs and LFs etc.. but nothing is

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread James Richters via fpc-pascal
I tried this: CSVData:=TCSVDocument.Create; CSVData.DetectBOM := True; CSVData.LoadFromFile(ParamStr(1)); Writeln('Read In: ',CSVData.RowCount,' Rows and ',CSVData.MaxColCount,' Columns'); Writeln('Press Enter to

[fpc-pascal] Issue with CSVDocument

2022-02-07 Thread James Richters via fpc-pascal
I have CSVDocument working, but something odd is happening. Everything is coming out as I expect, Except for the first cell.. it has some garbage at the beginning of it that I don't understand. I'm on a Windows 10 64bit PC running the Win32 FPC Trunk installed today with fpcdeluxe. Here's my

[fpc-pascal] Text Only printing on Windows.

2022-02-09 Thread James Richters via fpc-pascal
Way back in the old Turbo Pascal days, it was super simple to send text to a printer. I had written a program that printed text on labels in the order the labels were needed.. the whole thing took me less than an hour to write and labels were spewing out of the printer. I haven't had a need to

Re: [fpc-pascal] Text Only printing on Windows.

2022-02-09 Thread James Richters via fpc-pascal
Thanks for the information. It's not a Dymo printer, it's a Zebra printer. But maybe it will work in a similar way.. James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Putting Delimited text into a StringList

2022-02-06 Thread James Richters via fpc-pascal
I'm trying to get Comma Delimited Text from a CSV File created with Microsoft Excel into a string list, but I keep getting spaces as delimiter characters. How can I prevent this and use ONLY commas as delimiters? I hardcoded a test string in and it is delimiting on spaces and commas, but I wand

Re: [fpc-pascal] Putting Delimited text into a StringList

2022-02-06 Thread James Richters via fpc-pascal
Thank you for correcting my error, that did work, but I think I will take your advice and try to use TCSVDocument, that looks like it will be much simpler and give me a 2 dimensional array which is what I really wanted to end up with. Thanks for the documentation link and the suggestion! James

Re: [fpc-pascal] Putting Delimited text into a StringList

2022-02-07 Thread James Richters via fpc-pascal
I'm trying to use TCSVDocument, I have: Uses Math,sysutils,Classes,CSVReadWrite; That seems to be fine, But I get an error 1D.pas(18,17) Error: Identifier not found "TCSVDocument" On a line: Var CSVData : TCSVDocument; Do I need another unit or am I doing something wrong? James

Re: [fpc-pascal] Putting Delimited text into a StringList

2022-02-07 Thread James Richters via fpc-pascal
Yes, that's it, thank you. I see it there on: https://www.freepascal.org/daily/doc/fcl/csvdocument/tcsvdocument.html Source position: csvdocument.pp line 59 For some reason I thought CSVReadWrite was the unit. James ___ fpc-pascal maillist -

[fpc-pascal] FPConnect Timeout

2022-06-08 Thread James Richters via fpc-pascal
Is there any way to specify a shorter timeout for FPConnect? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPConnect Timeout

2022-06-08 Thread James Richters via fpc-pascal
Of Dimitrios Chr. Ioannidis via fpc-pascal Sent: Wednesday, June 8, 2022 1:11 PM To: fpc-pascal@lists.freepascal.org Cc: Dimitrios Chr. Ioannidis Subject: Re: [fpc-pascal] FPConnect Timeout Hi, Στις 8/6/2022 7:27 μ.μ., ο/η James Richters via fpc-pascal έγραψε: > Is there any way to specify a shor

Re: [fpc-pascal] BoolToStr

2022-08-29 Thread James Richters via fpc-pascal
Thanks for the discussion everyone, it does shed some light on what's going on. I agree it would be impossible to change it now, It was actually a GREAT idea to make it customizable, and that serves my needs just fine. I guess all that's left is to update the documentation to show what it

[fpc-pascal] BoolToStr

2022-08-28 Thread James Richters via fpc-pascal
I'm generating a report where I wish to display some Boolean values. I thought I would try BoolToStr, as according to: https://www.freepascal.org/docs-html/rtl/sysutils/booltostr.html it states: Description BoolToStr converts the boolean B to one of the strings 'TRUE' or 'FALSE' So it should

Re: [fpc-pascal] BoolToStr

2022-08-28 Thread James Richters via fpc-pascal
to be used for general purpose applications output something that does not conform to other Pascal Boolean datatypes and just confuses everyone. James Op 8/28/2022 om 8:45 PM schreef Ralf Quint via fpc-pascal: On 8/28/2022 8:23 AM, James Richters via fpc-pascal wrote: Running "i:\booltostr.ex

Re: [fpc-pascal] BoolToStr

2022-08-28 Thread James Richters via fpc-pascal
eds. James. -Original Message- From: fpc-pascal On Behalf Of Michael Van Canneyt via fpc-pascal Sent: Sunday, August 28, 2022 11:39 AM To: ja...@productionautomation.net; FPC-Pascal users discussions Cc: Michael Van Canneyt ; James Richters Subject: Re: [fpc-pascal] BoolToStr On Sun,

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 ' +

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

2022-09-20 Thread James Richters via fpc-pascal
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' Cc: James Richters ; 'Alexander Hofmann' Subject: Re: [fpc-pascal

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

<    1   2   3   4   5   6   >