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

Running dos progs from LB3

Expand Messages
  • Dave Lewis
    Hi! Can anyone help me I am running a DOS program from a LB3 program using the RUN command and I have 2 problems:- 1. The DOS prog only runs for approx 0.5
    Message 1 of 15 , Feb 1, 2002
    • 0 Attachment
      >
      Hi!
           Can anyone help me I am running a DOS program from a LB3 program using the "RUN" command and I have 2 problems:-
       
      1.   The DOS prog only runs for approx 0.5 sec and the returns to LB3 but the DOS window flashes on and off ,can I stop that?
       
      2.   If there is any problem with the DOS prog running an error occurs and LB3 closes the LB3 prog down, can I trap a DOS error and continue to execute the LB3 prog?
        Hope someone can help.
       
                                              Thanks Dave.
       
       
      ____________________________________________________
        IncrediMail - Email has finally evolved - Click Here
    • watson
      Issue #93 - The Liberty BASIC Newsletter is out. Get your copy here: http://groups.yahoo.com/group/lbnews/ In this issue: A new direction for the newsletter.
      Message 2 of 15 , Feb 1, 2002
      • 0 Attachment
        Issue #93 - The Liberty BASIC Newsletter is out. Get your copy here:

        http://groups.yahoo.com/group/lbnews/

        In this issue:
        A new direction for the newsletter.
        Contest Update
        Introducing Liberty BASIC 3!
        Updating the Open Source Editor
        Tip Corner... COLORDIALOG
        Callbacks Explained
        Drag 'n' Drop API Functions
        Drag 'n' Drop in LB3 by Mitchel Kottler
        Spotlight - the Gnu/Liberty BASIC Compiler System
        by Anthony Liguori
        - LB2BCX
      • Doyle Whisenant
        ... Yes. Have a look at the CreateProcess API call. The code in particular that does what you want is: si.dwFlags = STARTF_USESHOWWINDOW si.wShowWindow =
        Message 3 of 15 , Feb 1, 2002
        • 0 Attachment
          > 1. The DOS prog only runs for approx 0.5 sec and the returns to LB3 but the DOS window flashes on and off > can I stop that?


          Yes. Have a look at the "CreateProcess" API call.

          The code in particular that does what you want is:

          si.dwFlags = STARTF_USESHOWWINDOW
          si.wShowWindow = SW_HIDE

          This is part of the STARTUPINFO structure. I have used this very
          successfully to run all types of programs, DOS included without the ugly
          black window flashing up. I use this in my BCXtoEXE utility for BCX.

          I don't have code for LB3 but I do for BCX. Maybe someone will translate
          this for you as I don't have LB3.

          Notes:

          ssi,i,exitcode are integer variables
          STARTUPINFO, PROCESS_INFORMATION are Win32 structures

          WaitFlag is a global variable which determines if CreateProcess runs the
          program (App$) and waits for that program to finish execution or not.

          1 = wait
          0 = don't wait


          FUNCTION BCX_CreateProcess(App$)
          LOCAL si AS STARTUPINFO
          LOCAL pi AS PROCESS_INFORMATION
          LOCAL prochand AS HANDLE
          LOCAL ssi
          LOCAL i
          LOCAL exitcode
          ssi = sizeof(STARTUPINFO)
          ZeroMemory (&si, ssi)
          si.cb = ssi
          si.dwFlags = STARTF_USESHOWWINDOW
          si.wShowWindow = SW_HIDE
          i = CreateProcess(NULL, App$, NULL, NULL, FALSE,
          NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi)
          prochand = pi.hProcess
          IF WaitFlag = 1 Then
          exitcode = STILL_ACTIVE
          WHILE exitcode = STILL_ACTIVE
          Sleep(100)
          GetExitCodeProcess(prochand, &exitcode)
          WEND
          FUNCTION = i
          END IF
          CloseHandle(pi.hThread)
          CloseHandle(pi.hProcess)
          FUNCTION = 0
          END FUNCTION

          and here it is in C translated by BCX:

          int BCX_CreateProcess (char *App)
          {
          static STARTUPINFO si;
          memset(&si,0,sizeof(si));
          static PROCESS_INFORMATION pi;
          memset(&pi,0,sizeof(pi));
          static HWND prochand;
          memset(&prochand,0,sizeof(prochand));
          static int ssi;
          memset(&ssi,0,sizeof(ssi));
          static int i;
          memset(&i,0,sizeof(i));
          static int exitcode;
          memset(&exitcode,0,sizeof(exitcode));
          ssi=sizeof(STARTUPINFO);
          ZeroMemory(&si,ssi);
          si.cb=ssi;
          si.dwFlags=STARTF_USESHOWWINDOW;
          si.wShowWindow=SW_HIDE;
          i=CreateProcess(NULL,App,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
          prochand=pi.hProcess;
          if(WaitFlag==1)
          {
          exitcode=STILL_ACTIVE;
          while(exitcode==STILL_ACTIVE)
          {
          Sleep(100);
          GetExitCodeProcess(prochand,&exitcode);
          }
          return i;
          }
          CloseHandle(pi.hThread);
          CloseHandle(pi.hProcess);
          return 0;
          }

          --
          Doyle Whisenant
          mechanic@...
          http://www.mechanic.0catch.com/
        • bbjen@bigfoot.com
          The updated newsletter index and list of contents are attached. Beautiful NL0093, Alyce! Thanks for putting me back to work. It feels great! Bill J. ... LB
          Message 4 of 15 , Feb 2, 2002
          • 0 Attachment
            The updated newsletter index and list of contents are attached.

            Beautiful NL0093, Alyce! Thanks for putting me back to work. It feels great!

            Bill J.
            --------------------------------------------
          • watson
            ... great! ... Hi Bill, Terrific, as usual. Did you mean to send this to lbnews? (Nice to see it here also... gives folks an idea what is available in the
            Message 5 of 15 , Feb 2, 2002
            • 0 Attachment
              At 08:09 AM 2/2/02 -0500, you wrote:
              >The updated newsletter index and list of contents are attached.
              >
              >Beautiful NL0093, Alyce! Thanks for putting me back to work. It feels
              great!
              >
              >Bill J.

              Hi Bill,

              Terrific, as usual. Did you mean to send this to lbnews? (Nice to see it
              here also... gives folks an idea what is available in the newsletters.)

              Best,
              Alyce
            • bbjen@bigfoot.com
              Can someone help me with this? The code only shows the second textbox, instead of both. Window type seems not to matter. Problem is in LB2 as well as LB3. I
              Message 6 of 15 , Feb 5, 2002
              • 0 Attachment
                Can someone help me with this?
                The code only shows the second textbox, instead of both.
                Window type seems not to matter.
                Problem is in LB2 as well as LB3.
                I must be overlooking something simple.

                Bill J.
                '------------------------------------------------

                j=1 : y=j*30-30 : print "y= ";y
                textbox #w2.tb1,190,y,50,28
                j=j+1 : y=j*30-30 : print "y= ";y
                textbox #w2.tb2,190,y,50,28
                j=j+1
                ' open "PILLS ON HAND" for dialog_modal as #w2
                open "PILLS ON HAND" for window as #w2
                WAIT

                ---
                [This E-mail was scanned for viruses by http://www.intouchmi.com]
              • watson
                ... Maybe this is a bug in LB, maybe not. The textboxes are both being placed at the last value of y. Try changing the variable, or remming out the second
                Message 7 of 15 , Feb 5, 2002
                • 0 Attachment
                  At 03:30 PM 2/5/02 -0500, you wrote:
                  >Can someone help me with this?
                  >The code only shows the second textbox, instead of both.
                  >Window type seems not to matter.
                  >Problem is in LB2 as well as LB3.
                  >I must be overlooking something simple.

                  Maybe this is a bug in LB, maybe not. The textboxes are both being placed
                  at the last value of y. Try changing the variable, or remming out the
                  second textbox command but leave in the second y calculation and it is
                  still set at the second value for y. Try remming out the second textbox
                  AND the second routine to set y and the first textbox is positioned properly.

                  Alyce
                • Enrique Bird
                  Bill, There are 2 things wrong here: 1st The first Open is commented, it has an apostrophe at the beginning so it will not execute. 2nd The 2 handles
                  Message 8 of 15 , Feb 5, 2002
                  • 0 Attachment
                    Bill,

                    There are 2 things wrong here:

                    1st The first Open is commented, it has an apostrophe " ' " at the beginning
                    so it will not execute.
                    2nd The 2 handles must have different numbers.

                    Best regard,

                    Enrique F. Bird Picó

                    Business:
                    Telephone ==> (787) 751-4343 ext. 343 Cellular ==> (787) 319-7983
                    Beeper ==> (787) 250-0140 unidad 389-6131
                    Fax ==> (787) 764-2908 Email ==> ebird@...
                    Personal:
                    Telephone ==> (787) 757-3909 Email ==> enfbirdp@...
                    Address ==> Urb. Berwind Estates
                    E1 Calle 7
                    San Juan, PR 00924-5745


                    > -----Original Message-----
                    > From: bbjen@... [SMTP:bbjen@...]
                    > Sent: Tuesday, February 05, 2002 4:30 PM
                    > To: libertybasic@yahoogroups.com
                    > Subject: [libertybasic] textboxes
                    >
                    > Can someone help me with this?
                    > The code only shows the second textbox, instead of both.
                    > Window type seems not to matter.
                    > Problem is in LB2 as well as LB3.
                    > I must be overlooking something simple.
                    >
                    > Bill J.
                    > '------------------------------------------------
                    >
                    > j=1 : y=j*30-30 : print "y= ";y
                    > textbox #w2.tb1,190,y,50,28
                    > j=j+1 : y=j*30-30 : print "y= ";y
                    > textbox #w2.tb2,190,y,50,28
                    > j=j+1
                    > ' open "PILLS ON HAND" for dialog_modal as #w2
                    > open "PILLS ON HAND" for window as #w2
                    > WAIT
                    >
                    > ---
                    > [This E-mail was scanned for viruses by http://www.intouchmi.com]
                    >
                    >
                    >
                    > To unsubscribe from this group, send an email to:
                    > libertybasic-unsubscribe@egroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >
                  • Moore, Brad
                    No, not 2 windows, 2 textboxes. I looked it over (desk check) and can t see the error. Are you using default window size or do you have that defined
                    Message 9 of 15 , Feb 5, 2002
                    • 0 Attachment
                      No, not 2 windows, 2 textboxes.

                      I looked it over (desk check) and can't see the error. Are you using
                      default window size or do you have that defined elsewhere? I do not have LB
                      handy right at the moment.

                      Enrique - I think the reason that there is a commented out tine is because
                      Bill chose to not test with a modal window. I suspect he will go back to
                      using his modal window after he figures out what is wrong.

                      Brad Moore
                      Systems Analyst
                      Weyerhaeuser (North Bend , OR)
                      541-756-9481
                      brad.moore@...

                      > ----------
                      > From: Enrique Bird[SMTP:enfbirdp@...]
                      > Reply To: libertybasic@yahoogroups.com
                      > Sent: Tuesday, February 05, 2002 12:56 PM
                      > To: libertybasic@yahoogroups.com
                      > Subject: RE: [libertybasic] textboxes
                      >
                      > Bill,
                      >
                      > There are 2 things wrong here:
                      >
                      > 1st The first Open is commented, it has an apostrophe " ' " at the
                      > beginning
                      > so it will not execute.
                      > 2nd The 2 handles must have different numbers.
                      >
                      > Best regard,
                      >
                      > Enrique F. Bird Picó
                      >
                      > Business:
                      > Telephone ==> (787) 751-4343 ext. 343 Cellular ==> (787)
                      > 319-7983
                      > Beeper ==> (787) 250-0140 unidad 389-6131
                      > Fax ==> (787) 764-2908 Email ==> ebird@...
                      > Personal:
                      > Telephone ==> (787) 757-3909 Email ==> enfbirdp@...
                      > Address ==> Urb. Berwind Estates
                      > E1 Calle 7
                      > San Juan, PR 00924-5745
                      >
                      >
                      > > -----Original Message-----
                      > > From: bbjen@... [SMTP:bbjen@...]
                      > > Sent: Tuesday, February 05, 2002 4:30 PM
                      > > To: libertybasic@yahoogroups.com
                      > > Subject: [libertybasic] textboxes
                      > >
                      > > Can someone help me with this?
                      > > The code only shows the second textbox, instead of both.
                      > > Window type seems not to matter.
                      > > Problem is in LB2 as well as LB3.
                      > > I must be overlooking something simple.
                      > >
                      > > Bill J.
                      > > '------------------------------------------------
                      > >
                      > > j=1 : y=j*30-30 : print "y= ";y
                      > > textbox #w2.tb1,190,y,50,28
                      > > j=j+1 : y=j*30-30 : print "y= ";y
                      > > textbox #w2.tb2,190,y,50,28
                      > > j=j+1
                      > > ' open "PILLS ON HAND" for dialog_modal as #w2
                      > > open "PILLS ON HAND" for window as #w2
                      > > WAIT
                      > >
                      > > ---
                      > > [This E-mail was scanned for viruses by http://www.intouchmi.com]
                      > >
                      > >
                      > >
                      > > To unsubscribe from this group, send an email to:
                      > > libertybasic-unsubscribe@egroups.com
                      > >
                      > >
                      > >
                      > > Your use of Yahoo! Groups is subject to
                      > http://docs.yahoo.com/info/terms/
                      > >
                      > >
                      >
                      >
                      > Yahoo! Groups Sponsor
                      > ADVERTISEMENT
                      > Click Here!
                      >
                      >
                      > To unsubscribe from this group, send an email to:
                      > libertybasic-unsubscribe@egroups.com
                      >
                      >
                      >
                      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                      >
                    • Moore, Brad
                      If you want to progammatically align the text boxes, simply place them all in one place, open the window and then do a PRINT #HANDLE, LOCATE X, Y, H ,W. Don t
                      Message 10 of 15 , Feb 5, 2002
                      • 0 Attachment
                        If you want to progammatically align the text boxes, simply place them all
                        in one place, open the window and then do a PRINT #HANDLE, "LOCATE X, Y, H
                        ,W.

                        Don't forget to refresh the window after you have done all the "locating" of
                        your controls.

                        Brad Moore
                        Systems Analyst
                        Weyerhaeuser (North Bend , OR)
                        541-756-9481
                        brad.moore@...

                        > ----------
                        > From: watson[SMTP:alycewatson@...]
                        > Reply To: libertybasic@yahoogroups.com
                        > Sent: Tuesday, February 05, 2002 12:52 PM
                        > To: libertybasic@yahoogroups.com
                        > Subject: Re: [libertybasic] textboxes
                        >
                        > At 03:30 PM 2/5/02 -0500, you wrote:
                        > >Can someone help me with this?
                        > >The code only shows the second textbox, instead of both.
                        > >Window type seems not to matter.
                        > >Problem is in LB2 as well as LB3.
                        > >I must be overlooking something simple.
                        >
                        > Maybe this is a bug in LB, maybe not. The textboxes are both being placed
                        > at the last value of y. Try changing the variable, or remming out the
                        > second textbox command but leave in the second y calculation and it is
                        > still set at the second value for y. Try remming out the second textbox
                        > AND the second routine to set y and the first textbox is positioned
                        > properly.
                        >
                        > Alyce
                        >
                        > To unsubscribe from this group, send an email to:
                        > libertybasic-unsubscribe@egroups.com
                        >
                        >
                        >
                        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                        >
                      • carlgundel
                        ... Sure looks like a bug to me. I ll look into it. -Carl
                        Message 11 of 15 , Feb 5, 2002
                        • 0 Attachment
                          --- In libertybasic@y..., watson <alycewatson@c...> wrote:
                          > At 03:30 PM 2/5/02 -0500, you wrote:
                          > >Can someone help me with this?
                          > >The code only shows the second textbox, instead of both.
                          > >Window type seems not to matter.
                          > >Problem is in LB2 as well as LB3.
                          > >I must be overlooking something simple.
                          >
                          > Maybe this is a bug in LB, maybe not.

                          Sure looks like a bug to me. I'll look into it.

                          -Carl
                        • Galapagos
                          Apparently the window considers the value of y only when it is opened. So, both have y as 30 and tb2 displays on top of tb1. Maybe Jack Baker ... From:
                          Message 12 of 15 , Feb 5, 2002
                          • 0 Attachment
                            Apparently the window considers the value of y only when it is opened. So,
                            both have y as 30 and tb2 displays on top of tb1.
                            Maybe

                            Jack Baker

                            ----- Original Message -----
                            From: <bbjen@...>
                            To: <libertybasic@yahoogroups.com>
                            Sent: Tuesday, February 05, 2002 2:30 PM
                            Subject: [libertybasic] textboxes


                            > Can someone help me with this?
                            > The code only shows the second textbox, instead of both.
                            > Window type seems not to matter.
                            > Problem is in LB2 as well as LB3.
                            > I must be overlooking something simple.
                            >
                            > Bill J.
                            > '------------------------------------------------
                            >
                            > j=1 : y=j*30-30 : print "y= ";y
                            > textbox #w2.tb1,190,y,50,28
                            > j=j+1 : y=j*30-30 : print "y= ";y
                            > textbox #w2.tb2,190,y,50,28
                            > j=j+1
                            > ' open "PILLS ON HAND" for dialog_modal as #w2
                            > open "PILLS ON HAND" for window as #w2
                            > WAIT
                            >
                            > ---
                            > [This E-mail was scanned for viruses by http://www.intouchmi.com]
                            >
                            >
                            >
                            > To unsubscribe from this group, send an email to:
                            > libertybasic-unsubscribe@egroups.com
                            >
                            >
                            >
                            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                            >
                            >
                          • carlgundel
                            ... opened. So, ... I think you nailed it Jack. I know how to fix it. ;-) -Carl
                            Message 13 of 15 , Feb 5, 2002
                            • 0 Attachment
                              --- In libertybasic@y..., "Galapagos" <jbaker@h...> wrote:
                              > Apparently the window considers the value of y only when it is
                              opened. So,
                              > both have y as 30 and tb2 displays on top of tb1.
                              > Maybe

                              I think you nailed it Jack. I know how to fix it. ;-)

                              -Carl
                            • bbjen@bigfoot.com
                              Thanks, guys. I m glad I stumbled across it, and I m even gladder that it s fixable! Bill J. ... [This E-mail was scanned for viruses by
                              Message 14 of 15 , Feb 5, 2002
                              • 0 Attachment
                                Thanks, guys.
                                I'm glad I stumbled across it, and I'm even gladder that it's fixable!

                                Bill J.
                                ------------------------------------------------------

                                At 10:31 PM 2/5/02 -0000, you wrote:
                                >--- In libertybasic@y..., "Galapagos" <jbaker@h...> wrote:
                                >> Apparently the window considers the value of y only when it is
                                >opened. So,
                                >> both have y as 30 and tb2 displays on top of tb1.
                                >> Maybe
                                >
                                >I think you nailed it Jack. I know how to fix it. ;-)
                                >
                                >-Carl
                                ---
                                [This E-mail was scanned for viruses by http://www.intouchmi.com]
                              • Chris Lukas (really 13)->
                                Is there any possible way to make it so you can input something into an HTML file. I m making(or am going to try to) an auto- password/username input so you
                                Message 15 of 15 , Oct 29, 2003
                                • 0 Attachment
                                  Is there any possible way to make it so you can input something into
                                  an HTML file. I'm making(or am going to try to) an auto-
                                  password/username input so you press a button on the program and if
                                  there is an html window or a login screen it would put it in
                                  automaticly?

                                  -Chris Lukas
                                  Group: http://groups.yahoo.com/group/Basic4Beginners/
                                  Homepage: http://cjprohelp.cjb.net/
                                Your message has been successfully submitted and would be delivered to recipients shortly.