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

Re: [libertybasic] Re: RUN command question

Expand Messages
  • Richard Thomas
    Hi guy; Sounds like fun! OK, LB seems to transfer control to the called program and wait until it s done then return control to the calling program. So, you
    Message 1 of 5 , Apr 1, 2005
    • 0 Attachment
      Hi guy;
      Sounds like fun! OK, LB seems to transfer control to the called program and
      wait until it's done then return control to the calling program. So, you
      can use a parm file to maintain your position in the target program. In the
      target program check to see if the scratch pad file exists, or you can leave
      it there and just check if it's empty. Then use the last processed record
      as the starting point for the re-entry run. When complete either kill the
      scratch pad file or clear it for an initial run of the target program.
      Create a screen, window, in the target program and use that window to end
      the target program. I use that technique and it's working fine. As for
      your Object Oriented process approach, I don't think multi-threading is
      something a compiler should be required to provide. It's a process of
      either the operating system or operating environment. programmers often use
      multi-threading techniques but you might take a look at the new Visual
      Studio and .Net environment which might provide such an environment if you
      do any serious programming requireing heavy cross application processing.
      See ya round the bend.
      Rick of Farmington Mich. USA
      ----- Original Message -----
      From: "om_namah_shivaya" <om_namah_shivaya@...>
      To: <libertybasic@yahoogroups.com>
      Sent: Friday, April 01, 2005 7:12 PM
      Subject: [libertybasic] Re: RUN command question


      >
      >
      > Here is an odd thing:
      >
      > I happen to have my "Big Fat Greek Menu" as a tkn in a folder which
      > contains all the dll's necessary to distribute a tkn. I did that so
      > I could see what its like, if it really works, etc. And I put
      > an icon to run it on my desktop.
      >
      > SO, I edited the source for bigfatmenu... included an option to run
      > the BAT file which will create haltusers.dat and stop my computation
      > program. Then, I launce LB, run my computational program (all of
      > this is in the LB folder) and THEN I run bigfatmenu from its folder
      > with separate dll's.... and everything works great... I tell
      > bigfatmenu to create the c:haltusers.dat file, I can see that it is
      > created... and the computational program senses that the file exists
      > and terminates..... BUT when I add the computational program to
      > bigfatmenu, and run everything from the same dll's in the same
      > folder.... then, the second program, to run the BAT file, freezes
      > up, never creates c:haltusers.dat, and I have to manually create the
      > halt folder from the DOS window... or from notepad... or worse...
      > everything locks up, and I have to alt ctr del and kill the LB
      > processes....
      > --- In libertybasic@yahoogroups.com, "om_namah_shivaya"
      > <om_namah_shivaya@y...> wrote:
      > >
      > > This form has two buttons.
      > > The first button RUN's a second LB program which is .tkn
      > >
      > > That second program goes into a loop of calculations, but
      > > every 10,000th iteration, it checks for the existence
      > > of a file c:\haltusers.dat
      > >
      > > IF it finds such a file, it writes its latest results out
      > > to another file and ends.
      > >
      > > My understanding of RUN is that the parent LB program continues
      > > to execute while the child program is running. Therefore, in theory
      > > a second button, which creates the c:\haltusers.dat file
      > > should be successful in stopping the child program.
      > >
      > > What happens when I test the two programs, is that the parent
      > program
      > > (code below) seems to be locked up while the child is running.
      > > If I go to DOS window, and run the batch file, which simply routes
      > > a DIR to c:\haltusers.dat , then the child program stops.
      > >
      > > I find it useful to be able to stop this long calculation program,
      > > which can run for days, and have it save where its at, and resume
      > > where it left off the next time I run it. All that works fine, IF
      > I
      > > create the dummy file using notepad or a BAT file called through
      > DOS.
      > >
      > > I was hoping for something more slick, in terms of a parent LB
      > > window launching and halting the child program.
      > >
      > > Thanks in advance for suggestions, advice.
      > >
      > > ========================code start
      > > 'Form created with the help of Freeform 3 v03-27-03
      > > 'Generated on Apr 01, 2005 at 17:50:21
      > >
      > >
      > > [setup.main.Window]
      > >
      > > '-----Begin code for #main
      > >
      > > WindowWidth = 550
      > > WindowHeight = 410
      > > UpperLeftX=int((DisplayWidth-WindowWidth)/2)
      > > UpperLeftY=int((DisplayHeight-WindowHeight)/2)
      > >
      > >
      > > '-----Begin GUI objects code
      > >
      > > button #main.button1,"Launch findfirst",[button1Click], UL,
      > > 55, 32, 135, 25
      > > button #main.button2,"Halt findfirst",[button2Click], UL,
      > 60,
      > > 97, 130, 25
      > >
      > > '-----End GUI objects code
      > >
      > > open "Launch Findfirst" for window as #main
      > > print #main, "font ms_sans_serif 10"
      > >
      > > [loop]
      > > wait
      > > [button1Click]
      > > run "findfirst.tkn"
      > > goto [loop]
      > >
      > > [button2Click]
      > > notice "about to halt"
      > > run "c:\haltusers.bat"
      > > goto [quit]
      > >
      > > [quit]
      > > close #main
      > > end
      > > ==================code end
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
    • bbeas00
      ... Some of the runtime files used with Liberty Basic create virtual environments for the running token programs. I doubt they all support multithreading.
      Message 2 of 5 , Apr 1, 2005
      • 0 Attachment
        > -----Original Message-----
        > From: om_namah_shivaya [mailto:om_namah_shivaya@...]
        > Sent: Friday, April 01, 2005 6:13 PM
        > To: libertybasic@yahoogroups.com
        > Subject: [libertybasic] Re: RUN command question
        >
        >
        >
        > Here is an odd thing:
        > BUT when I add the computational program to
        > bigfatmenu, and run everything from the same dll's in the same
        > folder.... then, the second program, to run the BAT file, freezes
        > up, never creates c:haltusers.dat, and I have to manually create the
        > halt folder from the DOS window... or from notepad... or worse...
        > everything locks up, and I have to alt ctr del and kill the LB
        > processes....

        Some of the runtime files used with Liberty Basic create virtual
        environments for the running token programs. I doubt they all support
        multithreading. Running your tokens in different directories with their own
        copies of the runtime files seems to work for you. Let well enough alone for
        now pending the next generation of the LB programs.

        Regards,
        Bill Beasley
      • pendl2megabit
        And there is one known bug: If you use the line: RUN mychildprog.tkn Then LB will wait for the execution of the called TKN to end, and there will be some
        Message 3 of 5 , Apr 4, 2005
        • 0 Attachment
          And there is one known bug:

          If you use the line:
          RUN "mychildprog.tkn"

          Then LB will wait for the execution of the called TKN to end, and there will
          be some running instances of your runtime engine left.

          ---

          If you use the line:
          RUN "mymainprog.exe mychildprog.tkn"

          Then all should work as expected and the processes will end properly.

          ---
          Stefan Pendl


          > -----Ursprungliche Nachricht-----
          > Von: bbeas00
          >
          > Some of the runtime files used with Liberty Basic create virtual
          > environments for the running token programs. I doubt they all support
          > multithreading. Running your tokens in different directories with their own
          > copies of the runtime files seems to work for you. Let well enough alone for
          > now pending the next generation of the LB programs.
          >
          > Regards,
          > Bill Beasley
        Your message has been successfully submitted and would be delivered to recipients shortly.