SRL Archive - Discussions and Debates

Integers, Strings, ect, maybe more?


Rune Hacker

2007-05-19 21:35:45

Well, this is my second time gettign stuck on this, why are there only like 3-4 of each of them? Why not let us use like 20, i just think that would help a lot if added in srl, i dont see what there is too lose. There are only 4 integers i can use, but ide like way more to use. So would it be possible to get like 20 or so of each ot use, or why not? I just dont get why only 3 or 4 of each are useable.

Widget

2007-05-19 21:41:35

Ummm… Do you mean like the fact that BigInteger, SmallInt, Integer, Double, Single, Word, and LongWord are all almost identical?

Rune Hacker

2007-05-19 21:47:27

Well, im using Integer1 and Integer2 for a form i made, and for the script, i want each player to keep track of thier individual proggys, but i need like 4 more integers for that. I know there is extended and stuff which works kinda the same, but why are there only 3 or 4 of each thing, ide like more to use. And what do you mean by all those BigInteger and things you said?

Infantry001

2007-05-19 22:14:02

You can manually add more integers if you want. But srl should have an option to add more integers/booleans/string etc, i agree.

Smartzkid

2007-05-19 22:16:34

BigInteger and all the other stuff Widget was talking about are variants of the normal Integer, String, etc. Example: Integer can only store numbers up to x limit. BigInteger is far larger. It could be expressed by x squared. (doubt that's correct, but, hey, you get the point, right?)

I just make my own arrays to store report data…

danrox2004

2007-05-19 22:26:05

You could make a new array to store all the extra stuff you want. For example:

var
ExtraStuff: Array of Array[0..3] of integer;

SetArrayLength(ExtraStuff, GetArrayLength(Players));

then you could use it like:
Players[currentplayer][0] := Logs + 27;

or you could use types, like the players array and do

type ExtraStuff := record
LogsChopped: Integer;
TimesClicked: Integer;
end;

var
Extra: Array of ExtraStuff;

SetArrayLength(Extra, GetArrayLength(Players));
Extra[CurrentPlayer].LogsChopped := 35;

Rune Hacker

2007-05-19 23:15:01

Eh, that stuff is confusing lol. Ide rather just have more integers, strings, etc to use in SRL. I mean, why not, why are there so few to use? I don't see what there is to use. Im just saying that it would be a good idea to add more in the next SRL, but i could be wromg, idk. And is BigInteger, SmallInteger, and that stuff in SRL because i never saw them. Ty.

omgh4x0rz

2007-05-19 23:49:19

I use danrox's method, because if you use alot (such as the 20 you are suggesting) you can make things less confusing :)

Instead of having Integer1 -Integer7 and having to remember what they are for, I just make new types and name them something that fits, and can do Players[0].SomethingThatFits

Rune Hacker

2007-05-20 00:26:16

I like that method, but 1.) I dont use things until i know exactyl wha teverything does and 2.) It still seems like a good idea to add more integers, strings, ect for use in SRL

SKy Scripter

2007-05-20 03:11:00

what i dont get why they didnt make it this…



program New;

type
TUser = record
Name: string; // * User Name
Pass: string; // * User Pass
Nick: string; // * Screen Name for random detection
Active: Boolean; // * Set to True if Ok, False if Lost.
Loc: string; // * User Location
Rand: string;
Skill: string; // * User Action to Perform
Level: array[0..21] of word; // * Levels of all skills. SetIn GetPlayerLevels.
Ore: string; // * test
WaitTime: Integer; // * Wait Time for Each User, Good for Autofighters
Fight: Boolean; // * If we want the Char to randomly fight
Worked: Integer; // * Time User has worked
Banked: Integer; // * Number of Banks User has done
Killed: Integer; // * Number of Kills User has made
Pin: Integer; // * Current Users Pin Number
AnyThing : Array [1..20] of Variant;
end;

Var
User : TUser;

begin
User.AnyThing[1] := 'Hello';
User.AnyThing[2] := 3;
User.AnyThing[3] := 2.33;

Writeln(User.AnyThing[1]);
Writeln(User.AnyThing[2]);
Writeln(User.AnyThing[3]);
end.

or somthing like that… :p

~alex~

2007-05-20 03:30:58

You could make your own type? Or just another array

Rune Hacker

2007-05-23 23:03:31

Could soemone either give me an idea of hwo to make my own thing like Players[CurrentPlayer].BlahBlah because i dont get hwo to in a script exactly :redface:

And, i still think adding more integers and strings in the next srl would be nice lol