Results 1 to 5 of 5

Thread: Results

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Results

    How do i get Scar to say the result?

    such as:
    SCAR Code:
    Writeln('Found : '+ Result);

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    The result of a function?

    Depends what the result is. Result is just like a local type variable. When writing a line to debug using WriteLn you need the input to be a string. So you'll need to convert the variable information to a string:

    So depending on the Result type,
    SCAR Code:
    Integer - Writeln('Found' + IntToStr(Result));
    String - WriteLn('Found' + Result);
    Boolean - WriteLn('Found' + BoolToStr(Result));
    Extended - WriteLn('Found' + FloatToStr(Result));

  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks Zeph, i needed the boolean one. 1+

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you are using 3.20 you don't need (Int/Bool/Float)toStr.

  5. #5
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You do if you're adding a non-string to a string. Ex. writeln(1); would work, but writeln('1' + 1); wouldn't.

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
  •