Results 1 to 4 of 4

Thread: Procedures?

  1. #1
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedures?

    Ok, i know this is my second thread . But anyways i was wondering if i wanted to use the login procedure from the core file? If it helps the file i want to use is called Login.

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    write {.include SRL\SRL.scar} at the top of your scritpt and it will include all the files in SRL\Core\
    Join the Official SRL IRC channel. Learn how to Here.

  3. #3
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, i get that but the problem is how would i use a certain procedure from a .scar file? Now i'm getting duplicate identifier "LOGINPLAYER"

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok you know how when you don't use an include, the script kinda looks like this:
    Code:
    Program new; // maybe intro text here
    
    type //types, if needed
    
    const // constants, if needed
    
    var //variables, if needed
    //                                        ------Procedure Section
    procedure p1;     
    begin
      //blah blah
    end;
    
    procedure p2;
    begin
      //blah blah
    end;
    //                                      --------- end Procedure Section
    //Main loop
    begin
    p1;
    end.
    Well when you include an include like srl by doing {.inclulde srl\srl.scar}, all the procedures and functions in that include are sorta in the procedure section automatically. You don't need to put them in there.

    So to use a procedure from SRL, just put {.include srl\srl.scar} near the top, and SetUpSRL; in the main loop. Then just call the procedure normally, as if it was in the procedure section.

    Duplicate indentifier probably means that you have a procedure in the procedure section that is already in SRL, loginplayer. Just take it out of the procedure section because it's already in SRL which you included.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Procedures in Procedures?
    By Geebly in forum OSR Help
    Replies: 4
    Last Post: 03-14-2008, 07:33 AM
  2. Help with procedures :s
    By Macro_FTW in forum OSR Help
    Replies: 1
    Last Post: 05-02-2007, 02:15 AM
  3. better procedures?
    By lilboy543 in forum OSR Help
    Replies: 3
    Last Post: 04-25-2007, 01:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •