Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread Jamesmail
should that be Find_Color:=BestChoice; ?? Yes, it should be, Also noticed a typo in my groupings, it wouldn't affect anything but I like to make it clear. So now I have this for the function: function Find_Color(Constref ColorArray :TVGA256Array; R ,G ,B : Word) : Byte; Var Dist,Closest:D

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Martok
Am 24.09.2017 um 14:50 schrieb Sven Barth via fpc-pascal: > Please report a bug. Well this is awkward - I tried to provide a test project for the report, and couldn't get it to *not* work. The real-world project that has this issue for me has the resource included from a file in a package, and it

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Martok
> Also note that that is only true for Windows. FPC doesn't include a > resource compiler for any other platforms. So if no resource compiler > exists, you will get a compilation error until you make other plans. AFAIK, windres is available for lots of other platforms. If you have to install som

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread Ralf Quint
On 9/24/2017 12:07 PM, James Richters wrote: > Thank you for explaining how to achieve this. > I am curious about the meaning behind the prefixes you used: >> TVGA256Array = Array[0..255] of VGARGBRec; >> PVGA256Array = ^TVGA256Array; > Do the T and P in front of VGA256Array have a special me

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 22:55, Graeme Geldenhuys wrote: > On 2017-09-24 19:02, Sven Barth via fpc-pascal wrote: >>> system if you want to use it as a linker, fpc does not provide it. >> Exactly. > > Exactly my point! Why? Why does the official FPC installer for Windows > give a more workable solution out of

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 21:07, James Richters wrote: > Thank you for explaining how to achieve this. > I am curious about the meaning behind the prefixes you used: >> TVGA256Array = Array[0..255] of VGARGBRec; >> PVGA256Array = ^TVGA256Array; > Do the T and P in front of VGA256Array have a special mean

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Graeme Geldenhuys
On 2017-09-24 19:02, Sven Barth via fpc-pascal wrote: system if you want to use it as a linker, fpc does not provide it. Exactly. Exactly my point! Why? Why does the official FPC installer for Windows give a more workable solution out of the box (1), but official installers for other platfor

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread James Richters
Thank you for explaining how to achieve this. I am curious about the meaning behind the prefixes you used: > TVGA256Array = Array[0..255] of VGARGBRec; > PVGA256Array = ^TVGA256Array; Do the T and P in front of VGA256Array have a special meaning or significance? I see things like that all

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
Am 24.09.2017 18:14 schrieb "Giulio Bernardi" : > > I think that what Sven meant is that fpc's Windows installers include binutils, > while this is not true for other platforms: that is, you need to have ld on your > system if you want to use it as a linker, fpc does not provide it. Exactly. Rega

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Giulio Bernardi
I think that what Sven meant is that fpc's Windows installers include binutils, while this is not true for other platforms: that is, you need to have ld on your system if you want to use it as a linker, fpc does not provide it. Same as for windres: if you need it, usually you can install it from m

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Graeme Geldenhuys
On 2017-09-24 16:49, Sven Barth via fpc-pascal wrote: Because it's only Windows that we provide a setup for. Huh? I've been downloading the official FPC console installers for FreeBSD and Linux since 6 years ago. I never use distro packages managers for FPC. Regards, Graeme -- fpGUI To

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 17:15, Graeme Geldenhuys wrote: > On 2017-09-24 13:50, Sven Barth via fpc-pascal wrote: >> You are aware that FPC supports resources on basically all platforms? > > I know that. What I meant is that FPC only ships with a Windows resource > compiler - ability to compile RC files to RE

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Graeme Geldenhuys
On 2017-09-24 13:50, Sven Barth via fpc-pascal wrote: You are aware that FPC supports resources on basically all platforms? I know that. What I meant is that FPC only ships with a Windows resource compiler - ability to compile RC files to RES files. All other platforms you have to find your o

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread wkitty42
On 09/24/2017 01:55 AM, Michael Van Canneyt wrote: Then define function Find_Color(anArray :PVGA256Array; r ,g ,b : Word) : Byte;  Var   Dist,closest:Double;   i,bestchoice:Byte; begin    Closest:=20;    For i:= 0 to 255 do   Begin Dist :=  ((R-AnArray^[i].R))*((R-AnArray

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 23.09.2017 22:31, Martok wrote: > Hi all, > > the $R directive accepts resource scripts (RC) and compiles the RES file from > it > on demand. > > However, that only happens if the RES file does not exist - if it does, the > resource compiler is never invoked. Even clean-building the unit from

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 12:12, Graeme Geldenhuys wrote: > On 2017-09-23 21:31, Martok wrote: >> the $R directive accepts resource scripts (RC) and compiles the RES >> file from it >> on demand. > > Also note that that is only true for Windows. FPC doesn't include a > resource compiler for any other platform

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Graeme Geldenhuys
On 2017-09-23 21:31, Martok wrote: the $R directive accepts resource scripts (RC) and compiles the RES file from it on demand. Also note that that is only true for Windows. FPC doesn't include a resource compiler for any other platforms. So if no resource compiler exists, you will get a compi