Results 1 to 5 of 5

Thread: Comparing two function...

  1. #1
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default Comparing two function...

    Why does this work? This one moves the other doesn't.

    I call them like this.

    Simba Code:
    setupsrl;
     paths;
     sps_setup(runescape_other,['DuelAR']);
     writeln(sps_getmypos);
     LetsGo;
    That works but this doesn't
    Simba Code:
    setupsrl;
     path;
     sps_setup(runescape_other['DuelAr']);
     writeln(sps_getmypos);
     Walking('Area');
    Simba Code:
    Procedure LetsGo;
    begin

     if sps_walkpath(toarea) then
      writeln('moving')
      else
      writeln('not moving');

    end;

    and this doesn't:
    Simba Code:
    Function Walking(Which: String): Boolean;
    begin
     If(Not(LoggedIn)) Then Exit;
     Result := False;
     case Lowercase(Which) of
      'Area':
      begin
       if SPS_WalkPath(ToArea) then
       status := 'walking to the portal'
     else begin
      status := 'failed walking to the portal';
      writeln(status + ' time running:' +timerunning);
     end;
      writeln(status + 'time running:' +timerunning);
      end;

      'Portal':
      begin
       if SPS_WalkPath(ToPort) then
       status := 'walking to the portal'
      else begin
       status := 'failed walking to portal';
       Writeln(status + 'time running:' +timerunning);
      end;
       Writeln(status + 'time running:' +timerunning);
       begin
        Writeln('Walking to '+Which);
        FFlag(0);
       end;
      end;
     end;
    end;
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  3. #3
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    Area and portal should be lowercase
    Just when I thought SimbaPascal wasn't case sensitive whatsoever!

  4. #4
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    thank you.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by Runehack123 View Post
    Just when I thought SimbaPascal wasn't case sensitive whatsoever!
    First, SimbaPascal isn't a thing. It's PascalScript. Second, strings are case sensitive because 'A' is much different from 'a'. And OP is doing case Lowercase(Which) and comparing it to 'Area' and 'Portal,' which means it will never happen, as it's comparing Which in lowercase.

    Also, in some other languages, string comparison will only be true if the strings are pointing to the same objects, so a = 'hi'; b = 'hi'; print(a = b); could print false.

    The more you know!

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
  •