Results 1 to 4 of 4

Thread: Probably A Stupid Question Regarding Functions

  1. #1
    Join Date
    Aug 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Probably A Stupid Question Regarding Functions

    This is probably a horrible question, but when writing a script, if you write a line such as:

    Simba Code:
    function ClickMusician: boolean;

    Does ClickMusician call upon a function from SRL, or is it just the arbitrary name of whatever you're writing?

    Hopefully this isn't too much of a "duh", I just have a hard time now knowing why things work.
    Last edited by kaiman299; 12-29-2011 at 09:39 AM.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    You can name your procedures and functions whatever you wish (as long as they are not the same as a procedure or function in SRL).

    They will only 'call upon' and use whatever you put between the begin/end after them.
    Simba Code:
    function ClickMusician: boolean;
    Begin
      Wait(100);
    End;
    Would not even need you to include SRL, but
    Simba Code:
    function ClickMusician: boolean;
    Begin
      If FindObj(bla) Then
      Begin
        Result:=True;
        Writeln('We Found Him');
      End;
    End;

    would 'call upon' SRL for using the FindObj function coded into SRL.

    All good and answered?

  3. #3
    Join Date
    Aug 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fantastic, thanks for the quick response. I'm actually watching your tutorial right now, just making sure I understand everything fully. Thanks again!

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Yup Yup! Enjoy those glad I could help!

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
  •