• Log in or sign up for an account here: https://www.sythe.org/login

Having Difficulty With This Variables Problem

  • Thread starter Thread starter Fort1fy
  • Start date Start date
F

Fort1fy

Guest
What I'm trying to do is make a script where a section of the code inputs a string of text. Each time the string is inputted, the variable is supposed to change by one value like this. Suppose the string I wanted to send was String#a, then it would look like this:
String1a
String2a
String3a
What code would do that?
 
Not quite sure what your asking, perhaps you could say what your gonna do with it to help us understand. So far though, i'm gonna guess that you want to set a as an integer (probly 0) and have it count up to a certain point, like 10 and input the string each count.
Code:
a:= a + 1;
that's probly not what you want but until further info that's what i think.
 
Code:
program New;

procedure SomeThing;
var
i : integer;
begin
repeat
 i := i + 1;
  Writeln('Like'+(inttostr(i))+'This?');
 Wait(3000);
until (i = 20);
end;

begin
ActivateClient;
SomeThing;
end.
Like this?
 
I think what you want to do is possible by using a string array. You could declare a string array and fill the different strings in the array with different values and then read the values by passing the corresponding integer. I'm just starting scripting, so I'm not sure if this syntax is correct, but I suppose it would look something like this:

Code:
StringA : Array[0..2] of String;

begin
 StringA[0] := 'this is string 1';
 StringA[1] := 'this is string 2';
 StringA[2] := 'this is string 3';

 WriteLn(StringA[1]);
end.

This would write 'this is string 2' to the debug window.

Town explains a bit about arrays in his tut: Learning to script from the basics to becoming an SRL Member

Hope this helps.
Stash.
 
Runescape Gamblingrunescape gambling
Back
Top