Announcement

Collapse
No announcement yet.

SLIC - For Loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SLIC - For Loop

    Anybody know the correct syntax for the SLIC For Loop? The documentation says;

    Code:
    For(i = 0; i < 10; i = i + 1) {
        code
        }
    but this produces syntax errors. And yes, I know For & While do the same thing. I just like For better for certain things.

    Don
    Don,
    CtPMaps (Hosted by Apolyton)

  • #2
    For loops? SLIC has for loops? I didn't knew that. Can't find them in the documentation either. Are you sure? If so, could you tell me where you got that documentation so I can check what I've been missing (or send it to me by email)? Thanks

    Locutus
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #3
      All,

      Just a reminder that there is a workaround to create user defined functions. By refering to the SLIC documentation which I have extracted as below :-
      While SLIC does not directly support user defined functions, there is a workaround. Using the Abort() function, you can create a MessageBox object that never displays a message. So call Abort() as the first line of a MessageBox object, then write any code you want inside the object, and call that MessageBox from anywhere you'd like with
      Message(0, 'NameOfYourMessageBox');
      The first argument to message is a player index, but since this message isn't going to display anything, it doesn't matter what index you use.

      Comment


      • #4
        Sorry about that. The for..loop wasn't in the documentation. It came from Activision. I actually have a bit more SLIC documentation and related stuff than I originally thought. I am in the process of putting it all together in a cohesive document. Then as we learn what does and doesn't work and how, I will update the document. Kind of like the SLIC v1.2 real documentation we didn't get.

        I will send it to our SLIC group when it is finished. If anybody else wants a copy, send me an email and let me know. My email is in my profile.

        Don
        Don,
        CtPMaps (Hosted by Apolyton)

        Comment

        Working...
        X