Loading ...
Sorry, an error occurred while loading the content.

Is there a way to totally reset a program without closing it?

Expand Messages
  • Ash
    Hi guys, I ve designed a program that maintains lists of groups of people. Each group is stored as a seperate text file, and each line of each text file is a
    Message 1 of 3 , Aug 30, 2006
    • 0 Attachment
      Hi guys,

      I've designed a program that maintains lists of groups of people.
      Each group is stored as a seperate text file, and each line of each
      text file is a person.

      When I first start the program, I can add people to groups, remove
      them from groups, or move them from one group to another. But unless
      I totally close the program and start it again, I can't try another
      operation without it doing some really weird stuff (deleting entire
      lists, inserting entire lists from other groups...) Basically, there
      is clearly a bug in my program (most likely related to some variables
      and/or arrays retaining their values when they should be empty), but I
      haven't been able to find the source.

      Here's my question. Is there a way to totally reset a program back to
      it's initial state, without closing it? What I need it to do is go
      right back to the start of the program once it has performed an
      operation, with all variables and etc. set to nothing, just like when
      the program is initially started.

      Anyone with any ideas?
    • Kevin
      I m not exactly sure what exactly you mean by reset your program. It could mean a lot of things. However, here s my suggestion. If you have any open files,
      Message 2 of 3 , Aug 30, 2006
      • 0 Attachment
        I'm not exactly sure what exactly you mean by "reset" your program. It
        could mean a lot of things. However, here's my suggestion.
        If you have any open files, close them. As a general programming
        practice as soon as i'm finished using a file in an operation i close
        it (except when the procedure really needs it to remain open). To rest
        the rest of your program, you could just reset all variables to zero,
        or a blank string. Maybe use the CLS command with your graphics to
        clear any unwritten graphics or whatever (check the help manual for
        specifics though).

        --- In libertybasic@yahoogroups.com, "Ash" <SpackoAsh@...> wrote:
        >
        > Hi guys,
        >
        > I've designed a program that maintains lists of groups of people.
        > Each group is stored as a seperate text file, and each line of each
        > text file is a person.
        >
        > When I first start the program, I can add people to groups, remove
        > them from groups, or move them from one group to another. But unless
        > I totally close the program and start it again, I can't try another
        > operation without it doing some really weird stuff (deleting entire
        > lists, inserting entire lists from other groups...) Basically, there
        > is clearly a bug in my program (most likely related to some variables
        > and/or arrays retaining their values when they should be empty), but I
        > haven't been able to find the source.
        >
        > Here's my question. Is there a way to totally reset a program back to
        > it's initial state, without closing it? What I need it to do is go
        > right back to the start of the program once it has performed an
        > operation, with all variables and etc. set to nothing, just like when
        > the program is initially started.
        >
        > Anyone with any ideas?
        >
      • John DeAngelo
        Ash, If you send me your program (bas file), I will debug it for you, just for fun. I have some spare time this weekend. Also, I will explain in english what
        Message 3 of 3 , Sep 1, 2006
        • 0 Attachment
          Ash,

          If you send me your program (bas file), I will debug it for you, just
          for fun. I have some spare time this weekend. Also, I will explain
          in english what the problem was.

          Kind regards,

          john

          nassaugeek.com
        Your message has been successfully submitted and would be delivered to recipients shortly.