How do I declare constant array of integers?
I tried:
Simba Code:const
worlds:array[1..5] of Integer=(5,6,9,18,21);
and its not working...
Also has Simba something like EOL (End Of Line) as it used to be in Pascal while reading files....?
How do I declare constant array of integers?
I tried:
Simba Code:const
worlds:array[1..5] of Integer=(5,6,9,18,21);
and its not working...
Also has Simba something like EOL (End Of Line) as it used to be in Pascal while reading files....?
Simba Code:program new;
var
TIA :TIntegerArray;
begin
TIA := [5,6,9,18,21]
end.
~Home
I think what home is trying to say is that you can't make constant arrays of integers in pascal script, and so you need to use a variable instead.
I do beleive constant integer array are supported in lape.
My scripts:
Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
Questions? I bet that for 98% of those, you'll find answer HERE
Const
P = [9, 0, 0, 4, 34];
lol just tried it, it actually doesnt let you, learn something new everyday -.-, ignore this post
Last edited by Kasi; 08-22-2012 at 06:54 PM.
Lape can do itSimba Code:program default;
const
i = [1,1];
begin
writeln(tostr(i));
end.
with Pascal script how do I add another number to TIntegerArray
do I have to use soemthing like:
Array[Length(Array)]:=number; or is there function for this?
Runaway thanks,
so there is nothing as dynamic array in Pascal script?
When lape is option anyway...
Simba Code:program new;
type
TSuperIntegerArray = record
val: TIntegerArray;
end;
var
a: TSuperIntegerArray;
procedure TSuperIntegerArray.push(v: Integer);
begin
SetLength(Self.val, Length(Self.val) + 1);
Self.val[High(Self.val)] := v;
end;
begin
a.push(3);
a.push(4);
writeln(a.val);
end.
Working on: Tithe Farmer
There is a very simple way: Set the length to a very high number, then you can freely add to it, and when you want to use it (such as when looping through the integers), you can just delete the integers with value 0. Will not work if there is a chance that your intended value is 0 though.
with PascalScript
Simba Code:var
TIA: array of TIntegerArray;
begin
tia := [[TIntegerArray([1, 2])], [TIntegerArray([3, 4])], etc];
end;
There are currently 1 users browsing this thread. (0 members and 1 guests)