Results 1 to 15 of 15

Thread: Variable Type OMG!

  1. #1
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Variable Type OMG!

    Why cant I print the compass angle?

    Whenever I store anything in the Extended variable type, I get confused. What is it for anyways?

    SCAR Code:
    program New;
    {.Include SRL\SRL.scar}

    var cAngle: Extended;

    begin
      SetupSRL;
      ActivateClient;
     
      cAngle := rs_GetCompassAngleDegrees;
     
      writeln(IntToStr(cAngle));
    end.
    PM me if you need any help with math.
    I can try to help you with anything!


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

    Default

    FloatToStr, not IntToStr.

  3. #3
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay thanks.

    Why doesn't SCAR use something more like PHP, rather than Pascal?
    I hate declaring stuff...
    PM me if you need any help with math.
    I can try to help you with anything!


  4. #4
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    because, pascal is cleaner, and easier to work with/ learn, and is also a lot like delphi :P
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  5. #5
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cleaner?

    I disagree...
    PM me if you need any help with math.
    I can try to help you with anything!


  6. #6
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Errmmm...

    This is kind of pathetic to ask, but how do you use the Else operator in SCAR?

    I never really figured out how...
    PM me if you need any help with math.
    I can try to help you with anything!


  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    if this = true then dothis else dothisthing;

    does that make any sence? :P that basic format is how its used, or you can do

    if thing then
    begin
    code here;
    end else
    more code;
    end;
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  8. #8
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You don't need a begin/end if it only does one thing.

    SCAR Code:
    procedure Whatever;
    begin
      if(OtherProcedure)then
        Something//if there is an else after this line, you don't have a semicolon. :)
      else
      begin
        Writeln('lolwat');
        TerminateScript;
      end;
    end;

    Hopefully that makes more sense. If you need more explaining, you can PM me or add me on MSN (panic._@live.com) .

  9. #9
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah that explains alot 99_ (Ian?), I always used a semicolon and thought 'else' wouldn't work without a begin and end :P

    EDIT: Off topic: How come I'm junior already 0o.

    Current Project:

    ChompieChopper - Early stages.

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You only need 10 posts/to be registered for a week And yeah, a lot of people get confused with that (even some members!) so don't worry too much. :] (My real name is Ian, so I'm changing my forum name to that).

  11. #11
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah, I thought you needed them both...

    Current Project:

    ChompieChopper - Early stages.

  12. #12
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nope. I can help you on MSN sometime if you want ^^ panic._@live.com

    Can't right now, going to bed 5:14 in the morning

  13. #13
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If it was to use any other language, I would much rather it be C++, due to simple necessities such as classes.

  14. #14
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by 99_ aka ian. View Post
    You don't need a begin/end if it only does one thing.

    SCAR Code:
    procedure Whatever;
    begin
      if(OtherProcedure)then
        Something//if there is an else after this line, you don't have a semicolon. :)
      else
      begin
        Writeln('lolwat');
        TerminateScript;
      end;
    end;

    Hopefully that makes more sense. If you need more explaining, you can PM me or add me on MSN (panic._@live.com) .
    i used begin/ end because there is usually more than one line unless its a failsafe or a procedure name or something
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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

    Default

    Because SCAR is not a loosely typed language, and PHP is.

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
  •