Having Difficulty With This Variables Problem

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

Having Difficulty With This Variables Problem
  1. Unread #1 - Jul 15, 2008 at 3:28 PM
  2. Fort1fy
    Referrals:
    0

    Fort1fy Guest

    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?
     
  3. Unread #2 - Jul 15, 2008 at 11:27 PM
  4. Nightmare0
    Joined:
    Mar 31, 2007
    Posts:
    104
    Referrals:
    0
    Sythe Gold:
    0

    Nightmare0 Active Member

    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.
     
  5. Unread #3 - Jul 20, 2008 at 8:10 PM
  6. †Death†
    Referrals:
    0

    †Death† Guest

    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?
     
  7. Unread #4 - Jul 21, 2008 at 2:29 AM
  8. stash
    Referrals:
    0

    stash Guest

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site