Results 1 to 6 of 6

Thread: Whats wrong with my syntax?

  1. #1
    Join Date
    May 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Whats wrong with my syntax?

    im new to coding in simba whats wrong with this code


    Code:
    Function Walk(bank: Boolean): Boolean;
     begin
        if bank = True  Then
          begin
          ObjDTM_WalkPath(['61:150:3:1:7:112:26:1:7:99:19:1:7:96:49',
           '28:128:3:1:7:113:109:1:7:74:113:1:7:53:131',
           '14:111:3:1:7:53:96:1:7:125:66:1:7:104:83',
           '40:72:3:1:7:121:62:1:7:32:84:1:7:15:76',
           '34:79:3:1:7:57:83:1:7:74:92:10:7:90:95'], 0, 100, 5, True, True);
           end;
        else
        begin
           ObjDTM_WalkPath(['154:76:3:10:7:137:97:10:7:137:67:10:7:43:120',
           '152:68:3:1:7:32:93:1:7:49:101:1:7:139:78',
           '139:36:3:1:7:70:96:1:7:121:83:1:7:142:65',
           '112:11:3:1:7:66:131:1:7:88:114:1:7:126:108'], 0, 100, 5, True, True);
           end;
    
     end;

  2. #2
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Take out the ; after the first end.

  3. #3
    Join Date
    May 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you very much. still learning here i know VB6 and C# working on a scrip to use a yak pak and make scrolls

  4. #4
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    I could explain this to you if you wish.

    When ending an if statement with an "else" you have to make sure it is "end else" if you started the statement with a begin. So for example you could do

    If loggedin then writeln("logged in") else writeln("not logged in");
    Because I didn't write "If loggedin then begin"

    But if you started it with a begin then you will need an end else. The downside with doing it this way is you can only have one function/procedure called after the if statement, if you want more, you need to start it with a begin.
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  5. #5
    Join Date
    May 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the input. my script i am working on is coming along good. probably will have the beta done tomorrow cycrosism once im done will you look at it and give me any input or hints on how to make it better? it will have comments and stuff in it so its easy to read. the standards i follow are probably not right but looks all right when you read the code.

  6. #6
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    Yes I could have a look at it, but I haven't coded in a while, if you do post the code here I am sure some other skilled members would be happy to look at it for you
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

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
  •