Re: [fpc-pascal] specify variable name with string variable

2019-07-09 Thread Santiago A.
El 08/07/2019 a las 22:43, James Richters escribió: ports that are defined by port numbers and pins in an ini file, Well, then they are dynamic. They are not hardcoded. I would use something like: TPortIdentifier=(Pin_1, pin_2, Port_x, Port_y...); TIOPort=object private FPo

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Stefan V. Pantazi
discussions Cc: Sven Barth Subject: Re: [fpc-pascal] specify variable name with string variable James Richters mailto:ja...@productionautomation.net> > schrieb am Mo., 8. Juli 2019, 22:44: SetStoragePinByName('Ini_Opto_Enable_Positive_Pin', True) ; And it would somehow

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
-pascal] specify variable name with string variable James Richters mailto:ja...@productionautomation.net> > schrieb am Mo., 8. Juli 2019, 22:44: SetStoragePinByName('Ini_Opto_Enable_Positive_Pin', True) ; And it would somehow get the value of 'Ini_Opto_Enable_Positive_Pin

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mo., 8. Juli 2019, 22:44: > SetStoragePinByName('Ini_Opto_Enable_Positive_Pin', True) ; > > And it would somehow get the value of 'Ini_Opto_Enable_Positive_Pin > That indeed sounds like something where you could use classes together with published properties. At least i

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
another array also referenced by the same string and then I could make my calls like that. James. From: fpc-pascal On Behalf Of Santiago A. Sent: Monday, July 8, 2019 3:40 PM To: fpc-pascal@lists.freepascal.org Subject: Re: [fpc-pascal] specify variable name with string variable El

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Santiago A.
El 07/07/2019 a las 21:58, James Richters escribió: This might sound silly, but is it possible to somehow specify a variable with a string containing the name of the variable? For example: Var MyVariable1 : Word; MyVariableName : String; Procedure ShowVariable(Variablename); Begin Wr

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Stefan V. Pantazi
: Monday, July 8, 2019 10:54 AM To: fpc-pascal@lists.freepascal.org Subject: Re: [fpc-pascal] specify variable name with string variable You can use the TFPGMap class in fgl unit to implement the dictionary. fgl should be available in 3.0.4. Try to replace the Generics.Collections with fgl and the

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Darius Blaszyk
> This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? Yes it certainly is. I wrote a unit that can handle arbitrary variable types for my project pmake. Pmake it a build tool for pascal. https://github.com/daar/pmake/blob

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
: Monday, July 8, 2019 10:54 AM To: fpc-pascal@lists.freepascal.org Subject: Re: [fpc-pascal] specify variable name with string variable You can use the TFPGMap class in fgl unit to implement the dictionary. fgl should be available in 3.0.4. Try to replace the Generics.Collections with fgl and the

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Stefan V. Pantazi
on how to compile the current source code? James -Original Message- From: fpc-pascal On Behalf Of James Richters Sent: Monday, July 8, 2019 6:48 AM To: 'FPC-Pascal users discussions' Subject: Re: [fpc-pascal] specify variable name with string variable Thank you for the answer

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Martin Frb
On 08/07/2019 14:09, James Richters wrote: I'm on windows Generics.Collections seems to be something that was added after 3.0.4, I've downloaded the current FPC source code, but I’m not sure how to build it.. can someone point me in the right direction on how to compile the current source

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Martin Frb
On 08/07/2019 14:09, James Richters wrote: I'm on windows Generics.Collections seems to be something that was added after 3.0.4, I've downloaded the current FPC source code, but I’m not sure how to build it.. can someone point me in the right direction on how to compile the current source

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
al Message- From: fpc-pascal On Behalf Of James Richters Sent: Monday, July 8, 2019 6:48 AM To: 'FPC-Pascal users discussions' Subject: Re: [fpc-pascal] specify variable name with string variable Thank you for the answer and the example... I didn't know there was such a thing as a

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
l On Behalf Of James Richters Sent: Monday, July 8, 2019 6:48 AM To: 'FPC-Pascal users discussions' Subject: Re: [fpc-pascal] specify variable name with string variable Thank you for the answer and the example... I didn't know there was such a thing as a variable dictionary, but It

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread James Richters
scal users discussions Subject: Re: [fpc-pascal] specify variable name with string variable Hi all! It's my first answer to the mailing list, hopefully I won't screw anything up. On Sun, Jul 7, 2019 at 10:58 PM James Richters wrote: > > This might sound silly, but is it pos

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread zh loza
Hi all! It's my first answer to the mailing list, hopefully I won't screw anything up. On Sun, Jul 7, 2019 at 10:58 PM James Richters wrote: > > This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? You might want to try u

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread James Richters
Is there an example of how declare them this way? I only have about 50 variables I wish to do this with. -Original Message- From: fpc-pascal On Behalf Of Michael Van Canneyt Sent: Sunday, July 7, 2019 6:20 PM To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] specify variable

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread Michael Van Canneyt
On Sun, 7 Jul 2019, James Richters wrote: This might sound silly, but is it possible to somehow specify a variable with a string containing the name of the variable? For example: Var MyVariable1 : Word; MyVariableName : String; Procedure ShowVariable(Variablename); Begin Writeln(Varia

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread Ryan Joseph
> On Jul 7, 2019, at 3:58 PM, James Richters > wrote: > > This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? Does you mean like RTTI so you can get a pointer to a local variable by name? I was actually curious about

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread Dmitry Boyarintsev
associative array? On Sunday, July 7, 2019, James Richters wrote: > This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? > > For example: > > Var >MyVariable1 : Word; >MyVariableName : String; > > Procedure ShowVar

[fpc-pascal] specify variable name with string variable

2019-07-07 Thread James Richters
This might sound silly, but is it possible to somehow specify a variable with a string containing the name of the variable? For example: Var MyVariable1 : Word; MyVariableName : String; Procedure ShowVariable(Variablename); Begin Writeln(Variablename,' = $', inttohex((Somehow get the