Results 1 to 10 of 10

Thread: Use one procedure in another

  1. #1
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Use one procedure in another

    I am trying to withdraw gp from my bank and then go buy something come back and do it again. But i only need to open my bank one time because another procedure handles opening the bank, so could i put just the procedure name in the login procedure, and i tried that but it says it does not identify it... would i have to copy/paste the withdraw gp procedure into the login procedure, or what?

  2. #2
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    SCAR Code:
    procedure bankopener;
    begin
      thestuff...
    end;

    procedure loginer;
    begin
      stuff...
      bankopener;
    end;

  3. #3
    Join Date
    Nov 2007
    Location
    Poland
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    begin
      setupsrl;
      activateclient;
      declarplayers;
      Loginplayer;
      openbank;
      repeat
        takegp;  
        gotobuy;
        buy;
        gotobank  // including openbank
      until(false);
    end.
    I thing that i helped.

  4. #4
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    SCAR Code:
    procedure bankopener;
    begin
      thestuff...
    end;

    procedure loginer;
    begin
      stuff...
      bankopener;
    end;
    So if you want to do that you have to declare what it does BEFORE what you want to use it in?

    Quote Originally Posted by iroki View Post
    SCAR Code:
    begin
      setupsrl;
      activateclient;
      declarplayers;
      Loginplayer;
      openbank;
      repeat
        takegp;  
        gotobuy;
        buy;
        gotobank  // including openbank
      until(false);
    end.
    I thing that i helped.
    I cant beleive i didnt think about that i think ill do that, ty =D

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Or you can paste the whole code into the other procedure

  6. #6
    Join Date
    Oct 2007
    Location
    brooklyn, new york
    Posts
    258
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  7. #7
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Or you can paste the whole code into the other procedure
    I was thinkin about doin that but i like this way more, takes more lines

    Quote Originally Posted by caustic View Post
    Just put OpenBankQuite before repeat, after begin. And your done with the bank 1 time thing.
    Its not a bank supported by that, i dont think...

  8. #8
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

  9. #9
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the bank procedure must be above the procedure that calls it, so in a way it is declaring it
    Project: Welcome To Rainbow

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or you can try doing a

    SCAR Code:
    procedure Blah1;
    begin
      blah2;
    end;

    procedure Blah2;
    begin
      writeln(':D');
    end;

    You would get unknown identifier "Blah2".
    So then try this

    SCAR Code:
    procedure Blah2; forward;

    procedure Blah1;
    begin
      blah2;
    end;

    procedure Blah2;
    begin
    writeln(':D');
    end;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure?
    By shadowrec0n in forum OSR Help
    Replies: 3
    Last Post: 02-11-2008, 09:04 PM
  2. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  3. Help with Procedure
    By Esteban in forum OSR Help
    Replies: 8
    Last Post: 07-06-2007, 03:45 AM
  4. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  5. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 PM

Posting Permissions

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