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

Run Again

Expand Messages
  • green8819
    I have updated my fcq.bas with some enhancements. I want to make 1 more improvement: I run the program. If I have to run it again, I have to close my first
    Message 1 of 6 , Feb 5, 2013
    • 0 Attachment
      I have updated my fcq.bas with some enhancements. I want to make 1 more improvement:

      I run the program.
      If I have to run it again, I have to close my first run, and then click fcq.bas again.

      How to do this with a "Run Again" button in the program itself?

      Any help appreciated.
    • Sarmed N.
      Save this code into exe (it must be), and you may run it a gain. It s work on my PC. I hope I got your point. code... NOMAINWIN     WindowWidth = 687 :
      Message 2 of 6 , Feb 5, 2013
      • 0 Attachment
        Save this code into exe (it must be), and you may run it a gain. It's work on my PC.
        I hope I got your point.

        'code...
        NOMAINWIN
            WindowWidth = 687 : WindowHeight = 446
            UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
            UpperLeftY = INT((DisplayHeight-WindowHeight)/2)


        Menu        #main, "&File" , "E&xit", [quit]
        stylebits   #main.button1, _BS_MULTILINE, 0, 0, 0
        button      #main.button1, "RUN AGAIN", button1Click, UL, 65, 85, 165, 35

        Open "Window Title" for Window as #main
            #main "trapclose [quit]"
            #main "font ms_sans_serif 10"

            Wait

        [quit]
            close #main : END

        Sub button1Click handle$
            Run DefaultDir$ +"\"+ "RAG.exe"
            End Sub
        'code.....
        Regards


        ________________________________
        From: green8819 <mike4612@...>
        To: libertybasic@yahoogroups.com
        Sent: Wednesday, February 6, 2013 8:15 AM
        Subject: [libertybasic] Run Again


         
        I have updated my fcq.bas with some enhancements. I want to make 1 more improvement:

        I run the program.
        If I have to run it again, I have to close my first run, and then click fcq.bas again.

        How to do this with a "Run Again" button in the program itself?

        Any help appreciated.




        [Non-text portions of this message have been removed]
      • Sarmed N.
        This code close then run, but it must be exe. ...code NOMAINWIN     WindowWidth = 687 : WindowHeight = 446     UpperLeftX =
        Message 3 of 6 , Feb 5, 2013
        • 0 Attachment
          This code close then run, but it must be exe.

          '...code
          NOMAINWIN
              WindowWidth = 687 : WindowHeight = 446
              UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
              UpperLeftY = INT((DisplayHeight-WindowHeight)/2)


          button      #main.button1, "RUN AGAIN", button1Click, UL, 65, 85, 165, 35

          Open "Window Title" for Window as #main
              #main "trapclose [quit]"
              #main "font ms_sans_serif 10"

              Wait

          [quit]
              close #main : END

          Sub button1Click handle$
              close #main
              Run DefaultDir$ +"\"+ "RAG.exe"
              END
              End Sub
          '...code


          ________________________________
          From: Sarmed N. <sarmednafi@...>
          To: "libertybasic@yahoogroups.com" <libertybasic@yahoogroups.com>
          Sent: Wednesday, February 6, 2013 10:15 AM
          Subject: Re: [libertybasic] Run Again


           
          Save this code into exe (it must be), and you may run it a gain. It's work on my PC.
          I hope I got your point.

          'code...
          NOMAINWIN
              WindowWidth = 687 : WindowHeight = 446
              UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
              UpperLeftY = INT((DisplayHeight-WindowHeight)/2)

          Menu        #main, "&File" , "E&xit", [quit]
          stylebits   #main.button1, _BS_MULTILINE, 0, 0, 0
          button      #main.button1, "RUN AGAIN", button1Click, UL, 65, 85, 165, 35

          Open "Window Title" for Window as #main
              #main "trapclose [quit]"
              #main "font ms_sans_serif 10"

              Wait

          [quit]
              close #main : END

          Sub button1Click handle$
              Run DefaultDir$ +"\"+ "RAG.exe"
              End Sub
          'code.....
          Regards

          ________________________________
          From: green8819 mike4612@...>
          To: libertybasic@yahoogroups.com
          Sent: Wednesday, February 6, 2013 8:15 AM
          Subject: [libertybasic] Run Again


           
          I have updated my fcq.bas with some enhancements. I want to make 1 more improvement:

          I run the program.
          If I have to run it again, I have to close my first run, and then click fcq.bas again.

          How to do this with a "Run Again" button in the program itself?

          Any help appreciated.

          [Non-text portions of this message have been removed]




          [Non-text portions of this message have been removed]
        • green8819
          I just realized that there is a simple answer to this particular question: A label such as [Start] right at the top. Then, Goto [Start] at the appropriate
          Message 4 of 6 , Feb 6, 2013
          • 0 Attachment
            I just realized that there is a simple answer to this particular question:
            A label such as [Start] right at the top. Then,
            Goto [Start]
            at the appropriate place in the code.

            I had done this before, but this instance something complicated took precedence in my mind, as though my question was:

            How do you run a 2nd program from one program? (chaining?)

            To answer this question, I have to specify the location of the 'other' program, as well as liberty.exe in the computer plus attrib, etc.

            Sarmed, good tries, both.

            --- In libertybasic@yahoogroups.com, "green8819" wrote:
            >
            > I have updated my fcq.bas with some enhancements. I want to make 1 more improvement:
            >
            > I run the program.
            > If I have to run it again, I have to close my first run, and then click fcq.bas again.
            >
            > How to do this with a "Run Again" button in the program itself?
            >
            > Any help appreciated.
            >
          • Jim Hiley
            If you want to have a delay before restarting, you can create a batch file with the following two lines: PING 1.1.1.1 -n 10 -w 1000 NUL daqCapture.exe The
            Message 5 of 6 , Feb 6, 2013
            • 0 Attachment
              If you want to have a delay before restarting, you can create a batch file
              with the following two lines:

              PING 1.1.1.1 -n 10 -w 1000 >NUL
              daqCapture.exe

              The first line gives a 10 second delay (10 pings with a timeout of 1 second
              each)
              Change the second line to the name of your application.

              Run the batch file from your application with
              run "doRestart.bat"

              This method gives everything a chance to shutdown before the restart.
              The delay is not always needed but I have found it useful when working with
              slow devices on serial ports etc.

              Jim

              -----Original Message-----
              From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
              Behalf Of green8819
              Sent: Wednesday, 6 February 2013 16:15
              To: libertybasic@yahoogroups.com
              Subject: [libertybasic] Run Again

              I have updated my fcq.bas with some enhancements. I want to make 1 more
              improvement:

              I run the program.
              If I have to run it again, I have to close my first run, and then click
              fcq.bas again.

              How to do this with a "Run Again" button in the program itself?

              Any help appreciated.
            • Marc Sabau
              Hi, This the best way / answer ! I use the same which runs well. Marc.
              Message 6 of 6 , Feb 6, 2013
              • 0 Attachment
                Hi,
                This the best way / answer ! I use the same which runs well.
                Marc.

                --- In libertybasic@yahoogroups.com, "green8819" wrote:
                >
                >
                >
                >
                > I just realized that there is a simple answer to this particular question:
                > A label such as [Start] right at the top. Then,
                > Goto [Start]
                > at the appropriate place in the code.
                >
                > I had done this before, but this instance something complicated took precedence in my mind, as though my question was:
                >
                > How do you run a 2nd program from one program? (chaining?)
                >
                > To answer this question, I have to specify the location of the 'other' program, as well as liberty.exe in the computer plus attrib, etc.
                >
                > Sarmed, good tries, both.
                >
                > --- In libertybasic@yahoogroups.com, "green8819" wrote:
                > >
                > > I have updated my fcq.bas with some enhancements. I want to make 1 more improvement:
                > >
                > > I run the program.
                > > If I have to run it again, I have to close my first run, and then click fcq.bas again.
                > >
                > > How to do this with a "Run Again" button in the program itself?
                > >
                > > Any help appreciated.
                > >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.