Good Day,
I'm not sure if this is possible or if I'm just being stupid here but I have this procedure that reads groups of data from a file I stored the data in. I want to use the procedure to change the value of variables which the program uses. The thing is that I have multiple variables that could potentially need to be assigned the values from the file. I don't want to turn it into a function since there are multiple things to output and multiple functions would require accessing the file multiple times to get the things in the right order. Of course I could just have one procedure for every combination of variables that are supposed to get the values from the file but that would require writing the same code multiple times. So that being said, is there some way to just pass into the procedure the variables I want to get the values and have their values permanently changed?
I tried doing this by letting the procedure require the procedure to take in variables and assign the values from the file to them
procedure ColorChanger (ColorFile:string; ColorName:string; ColorValue:integer);
For example, above I would want the procedure to take in some string variable for ColorName and the value for ColorName from the file be assigned to it.
I am using Lazarus v1.8.4 on Windows 10