Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29

Thread: Need help with this, if you can please

  1. #26
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tree_to_Cut_Logs is a String, you shouldn't use IntToStr when it's already a string.

    Edit: Tree_to_Cut_Logs actually isn't defined.
    Last edited by Rick; 11-05-2011 at 11:47 PM.

  2. #27
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by Blue90 View Post
    Sure i'll test it, get away from this a little...
    Actually the fixed version is different, im trying to implement couple more logs... and a Timer

    I actually added the semicolons after all the precedures, still nothing?

    Code:
    YouCode

    fixed:

    Simba Code:
    program puttingtogetherbasics;

    var
      Logs:Integer;
      Logs2:Integer;
      Exp:Extended;
      Timer:Extended;

    const
      Number_Of_Logs=500;
      Tree_To_Cut='Magic';
      Tree_To_Cut2='Yews';

    procedure HowManyLogs;
    begin
      Logs:=250;
      Logs2:=194;
      Exp:=195.5;
      Timer:=200.75;

      Writeln('We are waiting'+FloatToStr(Timer)+'Seconds to continue');   //bart: Float to string, cause Timer is an extended. If you're not sure use ToStr(x)
      Writeln('We currently have'+IntToStr(Logs)+'chopped');
      Wait(500);
      Writeln('We would like to obtain '+IntToStr(Number_Of_Logs)+' before we are done');  //Bart:  fixed a ' symbol
      Writeln('We are chopping' + Tree_To_Cut + ' trees!');                         //Bart:  fixed a ' symbol, and Tree_To_Cut is already a string, no need for conversion
    //  Writeln('When we are done, we will chop'+ IntToStr (Tree_to_Cut_Logs) +'trees');   Bart: No idea what you wanted here.
      Writeln('We have gained'+ FloatToStr(Logs*Exp)+ ' cutting Magics');     //Bart: Removed a ( and )
      Writeln('We have gained'+ FloatToStr(Logs2*Exp)+' cutting Yews');       //Bart: Removed a ( and )
    end;

    function WeAreBored:String;
    var
    s:String;
    begin
      result := 'What are we going to do now?';  //Bart: results doesn't exist, it is result
      s:='We are bored, we are going to chop now';    //Bart: You said String :=  this should be s :=
      wait(500);
      writeln(s);
      writeln('We are bored, we are going to chop now'); ///Without a string this would be implemented this way. Example of string implemenation is on line 34.
    end;

    begin  //Bart: added begin
      Cleardebug;
      HowManyLogs;
      Writeln(WeAreBored);
    end.
    Working on: Tithe Farmer

  3. #28
    Join Date
    Nov 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    I will be using the standards for now on, tabs seem to organize the project alot more. BTW FINISHED!
    Code:
    program puttingtogetherbasics;
    var
    Logs:Integer;
    Logs2:Integer;
    Exp:Extended;
    Timer:Extended;
    const
    Number_Of_Logs=500;
    Tree_To_Cut='Magic';
    Tree_To_Cut_2='Yew';
    procedure HowManyLogs;
    begin
    Logs:=250;
    Logs2:=194;
    Exp:=195.5;
    Timer:=200.00;
    
    Writeln('We are waiting '+FloatToStr(Timer/100)+' Seconds to continue');
    Writeln('We currently have '+IntToStr(Logs)+' chopped');
    Wait(500);
    Writeln('We would like to obtain '+IntToStr(Number_Of_Logs)+' before we are done');
    Writeln('We are chopping '+(Tree_To_Cut)+' trees!');
    Writeln('When we are done chopping magics, we are going to chop '+(Tree_To_Cut_2)+' trees!');
    Writeln('We have gained ' + FloatToStr(Logs*Exp) + ' cutting magics!');
    Writeln('We have gained ' +FloatToStr(Logs2*Exp)+' cutting Yews!');
    end;
    function WeAreBored:String;
    var
    s:String;
    begin
    result:='Done chopping yews';
    s:='We are bored, we are going to chop now';
    wait(500);
    writeln(s);
    writeln('Chopping yews...'); ///Without a string this would be implemented this way. Example of string implemenation is on line 34.
    end;
    begin
    Cleardebug;
    HowManyLogs;
    Writeln(WeAreBored);
    end.

  4. #29
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Don't use tabs, they don't come out good. I suggest reading http://www.kaitnieks.com/scar/scriptingsta/ .. it's a bit outdated but all the basic stuff still applies. Much easier to read.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

Page 2 of 2 FirstFirst 12

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
  •