Adblock breaks this site

Having Difficulty With This Variables Problem

Discussion in 'Scar/Simba Help' started by Fort1fy, Jul 15, 2008.

  1. Fort1fy

    Fort1fy Guest

    Referrals:
    0
    Having Difficulty With This Variables Problem

    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?
     
  2. Nightmare0

    Nightmare0 Active Member

    Joined:
    Mar 31, 2007
    Posts:
    104
    Referrals:
    0
    Sythe Gold:
    0
    Having Difficulty With This Variables Problem

    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.
     
  3. †Death†

    †Death† Guest

    Referrals:
    0
    Having Difficulty With This Variables Problem

    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?
     
  4. stash

    stash Guest

    Referrals:
    0
    Having Difficulty With This Variables Problem

    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.
     
< Tutorial on Scar?!? | Specifying client isnt working it is like the cursor cant get out of the SCAR program >


 
 
Adblock breaks this site