Using a Procedure to modify the value of any variable passed in lazarus / 9-Editor ---------------------------------------------------------------------- Micayah Ritchie · 2019-01-28 01:53 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 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 ---------------------------------------------------------------------- lucamar · 2019-01-28 02:06 Try this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure ColorChanger (ColorFile:string; var ColorName:string; var ColorValue:integer);or this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure ColorChanger (ColorFile:string; out ColorName:string; out ColorValue:integer); Maybe you should read the Language Guide and the rest of the docs, or find a good tutorial on Object Pasca (search the wiki). ---------------------------------------------------------------------- Micayah Ritchie · 2019-01-28 02:45 Thank you, I will try that, but I've been doing significant amounts of searching for explanations but sometimes it's difficult to know where to look for what and sometimes it would seem that explanations (reasonable) assume you already know a lot of things. That being said I should still try to read all the documentation. Thanks a lot. ---------------------------------------------------------------------- Handoko · 2019-01-28 03:01 Yeah, programming is a complex thing. The documentation is massive, we can get lost trying to find the information we need. Here are the things you need to know: https://www.freepascal.org/docs- html/current/ref/refsu66.html#x178-20000014.4.3 https://www.freepascal.org/docs- html/current/ref/refsu65.html#x177-19900014.4.2 https://www.freepascal.org/docs- html/current/ref/refsu64.html#x176-19800014.4.1