Announcement

Collapse
No announcement yet.

"ERASE ALL"?

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

  • "ERASE ALL"?

    Hi all,

    I'm kind-of embarrassed to ask this, but I'll do so anyway...

    Is there a command or way of erasing all variables (regardless of type, arrayed or non-arrayed) used in a program in without having to track-down each variable used, and individually 'ERASE' them?

    Effectively, I want to make the program to revert to a "just-loaded" state. Most everything I've written up until now have been "in & outers"; meaning that, the user launches the app, selects the file they want the program to process, and when it is finished, it pops-up a message box or something else that requires a user-response and exits after that. More & more, I'm needing to find a straight-forward way of when the "I'm done" requester pops-up, to (assuming the user chooses another iteration) "ERASE ALL" and start-over again.

    I did numerous searches on-line & using POFFS, and either this is such no-brainer than no one else even thought it necessary to post, or I must be searching using the wrong key-words.

    Thanks, and please keep the flames & chuckles to the minimum...

    Scott Martindale




    [This message has been edited by Scott Martindale (edited June 28, 2001).]

  • #2
    There is no native way to do it all with just one statement - you'll need to ERASE or RESET all arrays discretely.

    However, it would probably be easier to just asynchronously "start" a new instance of the the app and terminate the current one. For example:
    Code:
    #COMPILE EXE "MYAPP.EXE"
    FUNCTION PBMAIN
      IF INSTR(COMMAND$,"/restart") then ' we are restarting
        ... handle the restart here
      END IF
      ... other code goes here
      IF condition THEN
        Dummy& = SHELL("MYAPP.EXE /restart")
        EXIT FUNCTION
      END IF
      ... and even more code
    END FUNCTION
    ...just an idea...

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      No need to start a new instance, or even go through an extensive manual reset of all variables.

      Just make the user action a procedure using nothing but local variables.

      MCM
      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Thanks guys,

        Atleast it wasn't a "head-slapper"; thinking about it though, I guess it would have better for all concerned if it had been.

        Once again, thanks for your time!

        Scott Martindale
        DNA Productions, Inc.

        ------------------
        Scott Martindale
        Animation TD / Character Animator
        DNA Productions, Inc
        Dallas, Texas
        [email protected]

        Comment


        • #5
          Originally posted by Lance Edmonds:
          However, it would probably be easier to just asynchronously "start" a new instance of the the app and terminate the current one. For example:
          [/B]
          Cool Lance! I didn't know that a program could restart itself and then terminate.
          But then again, there is so much I don't know (yet) about PB..
          Eddy



          ------------------
          [email protected]
          Eddy

          Comment

          Working...
          X