Just wondering if you can make an array with constants? Something like
SCAR Code:const
t[0] = 0
t[1] = 1
t[2] = 2
t[3] = 4
t[4] = 16
If anyone knows if that or anything will work please drop a line![]()
Just wondering if you can make an array with constants? Something like
SCAR Code:const
t[0] = 0
t[1] = 1
t[2] = 2
t[3] = 4
t[4] = 16
If anyone knows if that or anything will work please drop a line![]()
Not possible with scar.
However, you can create a global var, the just load it in the beginning of the script like this:
As long as you don't touch it, it shouldn't matter if it's a var/constSCAR Code:TheArr := [1, 2, 6, 4, 23424, 42342];![]()
I made a new script, check it out!.
or if you want the user to change those consts just do a procedure at the beginning of the script
SCAR Code:procedure ConstantArray;
begin
Const[0] := 's';
Const[1] := 'a';
Const[2] := 'p';
end;
then call the proc at the beginning of the mainloop.
RM
dude you are calling consts in them middle of a procedure? shame yourself!
[22:20] <[-jesus-]> freddy, go uninstall yourself
Darn I was just hoping that I could to save on memory and time of using it? Because I have Path[0] to Path[4], and they are always the same so I wanted to constant. Oh well.
Why not do this.
SCAR Code:Const
Path[0] =
Path[1] =
Path[2] =
Path[3] =
Path[4] =
Var
Constant : Array[0..7] of integer;
Begin
For i := 0 to 4 do
Constant[i] := Path[i];
End.
Dunno, didn't really try that before tho..
Edit: Nevermind didnt work you get
SCAR Code:Line 6: [Error] (12585:5): is ('=') expected in script
So maybe ask freddy to add that hmm....?
No and besides that destroys the whole point of using constants instead of variables, in fact it uses more memory lol.
Only In Delphi
SCAR Code:const
C: array [0..2] of Integer = (1, 2, 3);
i believe that's how it's done..
Co Founder of https://www.tagcandy.com
SKy is a master! TYVM lol you are da man!
There are currently 1 users browsing this thread. (0 members and 1 guests)