SRL Archive - OSR Help

Can you IncEx strings?


Le Jingle

2012-04-07 05:09:11

I was wondering if it's possible to IncEx a string, here's an example of what I mean:


Program Help;
var
CGI:Integer;
NeedThis:String;
begin
IncEx(CGI, NeedThis); // or can it strictly only be a number? :/
//or this, which didn't work..
//IncEx(CGI, InToStr(NeedThis));
end.

JuKKa

2012-04-07 05:16:15

no, what is it that you want to achieve explain a bit more

Le Jingle

2012-04-07 05:26:46

I'm trying to have the user input their food experience at the top of the script, with a procedure that shows clear where it wants it, shown below:


program Food;

{$DEFINE SRL5}

{$i SRL/srl.simba}

var
FoodExp: String;
CGI:Integer;

procedure DetermineStuffs;
begin
FoodExp := ''; // For example choose 50, 100, or 150
end;

procedure Cook;
begin
IncEx(CGI, FoodExp);
end;

begin
DetermineStuffs;
repeat
Cook;
until(false);
end.

JuKKa

2012-04-07 05:29:31

why have them enter it as string, string is mainly used for text, not individual values.
here i changed it to a Integer


program Food;

{$DEFINE SRL5}

{$i SRL/srl.simba}

var
RSpassword, RSusername: String;
FoodExp, CGI:Integer;

procedure DetermineStuffs;
begin
FoodExp := 50; // For example choose 50, 100, or 150
RSusername := '';
RSpassword := '';
end;

procedure Cook;
begin
IncEx(CGI, FoodExp);
end;

begin
DetermineStuffs;
repeat
Cook;
until(false);
end.

eska

2012-04-07 05:48:57

You are trying to increment a number… that you stored in a string.

Instead of trying to find a way to make this work with a string (Which is the problem) you should really store it in an integer like JuKKa said.

Looking at your code, nothing seems to justify the use of a string.