Results 1 to 4 of 4

Thread: Procedure using Text Variable

  1. #1
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedure using Text Variable

    Simba Code:
    Procedure StateFunc(Var Text: string);
    Begin
     State := Text ;
    End;

    Procedure WithdrawLogs;
    Begin
     StateFunc('Withdrawing Logs');
     Withdraw(0,0,0);
    End;

    Im trying to use a procedure I made called 'StateFunc' (as it was originally a function) to determine what 'state' the script is in.

    The procedure, Changes the 'state' variable (a string) to whatever the input variable of the procedure is. It Then runs a progress report so that the state gets printed to smart and into the debug box.

    It basically stops me having to keep writing:

    State := 'xxx' ;
    ProgressReport;

    So instead i can just write

    StateFunc('xxx');


    However currently when it tries to compile it says 'expected variable' and highlights the first 'statefunc' procedure ( the part during the banking procedure not the actual statefunc procedure).

    What am i doing wrong?
    The truth finally came out...


  2. #2
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok i found the solution.

    The Procedure has to be followed by a predetermined string variable, like the one i'm trying to change.

    This means that his procedure is pretty much unnecessary, is there any way of changing that?

    I mean so that the input can be ('xxx') instead of (Name of String Variable)
    The truth finally came out...


  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    fixed
    Simba Code:
    Procedure StateFunc***40;Text: string***41;;
    Begin
     State := Text ;
    End;

    Procedure WithdrawLogs;
    Begin
     StateFunc***40;'Withdrawing Logs'***41;;
     Withdraw***40;0,0,0***41;;
    End;

  4. #4
    Join Date
    Aug 2007
    Location
    England
    Posts
    734
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm not going to lie, I'm pretty embarrassed right now. Thank you SO much
    The truth finally came out...


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
  •