![]() |
|
[Delphi] Globally Assign a Record Struct? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Delphi] Globally Assign a Record Struct? (/showthread.php?tid=5307437) |
Globally Assign a Record Struct? - ReversɘЯ - Jun 16, 2016 Hey Guys, was just wondering if I could somewhere globally assign a Records Struct I have... you see I don't wanna assign it anywhere in a local scope but in the global scope so it can be used anywhere: Code typeAny Ideas? I tried assigning itself but it won't let me.. * - Volty - Jun 16, 2016 Globally? It already is global. Even if you put record "color" into another unit, you can still use it. Please be a little more specific. My Code: Code program prjTest;Code unit UOther;* - ReversɘЯ - Jun 17, 2016 (Jun 16, 2016 06:28 PM)Volty Wrote: Globally? It already is global. Even if you put record "color" into another unit, you can still use it. Please be a little more specific. ok alright it's global, but I don't wanna use it in another unit, I wanna use it locally and within my app.. how can I call Color.Red and be read without giving me the error: "Expression has to be constant" or idk... ? * - Volty - Jun 17, 2016 (Jun 17, 2016 10:38 AM)ReversɘЯ Wrote: ok alright it's global, but I don't wanna use it in another unit, I wanna use it locally and within my app.. how can I call Color.Red and be read without giving me the error: "Expression has to be constant" or idk... ? Maybe this? (No errors for me) Code program prjTest;* - ReversɘЯ - Jun 17, 2016 (Jun 17, 2016 12:42 PM)Volty Wrote: Maybe this? (No errors for me) well it's working, i just wanted to use it in a function where I'm using a Case scenario: Code function yadayada(colorid: integer): string;it gives me an error saying Expression must be constant. or something like that... I just use it like this anyways... Code function yadayada(colorid: integer): string;Thx for helping out though |