Results 1 to 3 of 3

Thread: Varibles?

  1. #1
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Varibles?

    Ive read so many tuts and i still dont get scripting.I get confused on varibles and how to use them any help please an example wold be nice thanks.

  2. #2
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Variables are values which you store into script, see this example of string, string is between '(here)' and string is usually text, see this small scar script
    SCAR Code:
    program New;
    var
      Text:String;

    begin
    Text:='Lol';
    Writeln(Text)
    end.
    There's variable Text:String; and i made it "value" to text 'Lol' and writeln(Text) writes the variable Text:String;

    --------------------------------------------------

    Something about integers=Numbers
    SCAR Code:
    program New;
    var
      One,Two:Integer;

    begin
    One:=1
    Two:=2
    writeln(inttostr(One+Two))
    end.
    One,Two:Integer; are number variables, i declared variable One to number 1 and variable Two to number 2. writeln(inttostr(One+Two)) writes how much is variable One plus Variable Two. (inttostr means integer to string, you must have all written as string in writeln(); )

    --------------------------------------------

    About boolean variable:
    SCAR Code:
    program New;
    var
      IsItTen:Boolean;  //IsItTen is boolean, it returns as True or False
    var
      Count:Integer;//Dont mind about this.

    begin
    repeat
    wait(250)
    Count:=Random(11)//Gets the random number
    if(Count=10)then  //If random 11 numbers are 10, boolean IsItTen changes to True.
     IsItTen:=True    //
    else              //If random 11 numbers aren't 10, boolean IsItTehn will be False.
     IsItTen:=False;
    writeln('It is '+inttostr(Count))//This just writes the random number.
    if(IsItTen)then //If it is then... :D
     Writeln('IT IS TEN! OMG!!! OMFG! IT CANT BE TEN!!!')
    until(IsItTen)
    end.

    Hope this helps.

  3. #3
    Join Date
    Dec 2006
    Posts
    2,244
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks understanding abit more and i now know why it says duplicate x and y cause i already included srl i have tryed evrythink lol and still get stuck -.- the furthes i got into a script was using colour spira and cutting 28 logs then dropping i think i atchely need the ultimate tut anyway im off l8erz

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •