It worked!! Thanks a zillion!!!! Now I have a new toy to play with..... Mike Sinclair
________________________________ From: jan johansen <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Monday, November 7, 2011 6:36 PM Subject: [RBASE-L] - Re: Copying a file to a printer from within a timer Michael, An external form differs slightly. So create your external form and call it PrintTimer. Put the suggested code from Mike Byerly in it where indicated. In your main menu ON AFTER START eep put REFF PrintTimer.RFF You will now have 2 forms on the screen. Your MainMenu and your printjob form. Jan -----Original Message----- >From: "Michael J. Sinclair" <[email protected]> >To: [email protected] (RBASE-L Mailing List) >Date: Mon, 7 Nov 2011 15:20:16 -0800 (PST) >Subject: [RBASE-L] - Re: Copying a file to a printer from within a timer > > >Thanks Mike! >After I do what you wrote, do I do an EDIT USING formname or ENTER USING >formname? >You mentioned it runs in its own thread...does that mean it uses less memory >than runing a stand alone command file within as a continuous loop? >Thank you for your help!! >Mike Sinclair > >From: Mike Byerley <[email protected]> >To: RBASE-L Mailing List <[email protected]> >Sent: Monday, November 7, 2011 5:59 PM >Subject: [RBASE-L] - Re: Copying a file to a printer from within a timer > >You can use an external form which can run autonomously within the RBase >session. Use a Form timer. Use only this code in the Form Timer EEP: > > >SET Var vchkfile = (CHKFILE('c:\main\mike.txt')) >IF vchkfile = 1 THEN >COPY c:\main\mike.txt \\servername\printername >ERASE c:\main\mike.txt >ENDIF > > >put the initialization of the variable vChkFile in your onBefore Start EEP: > >SET Var vchkfile INTEGER > >Get in the habit of spelling VAR fully. RStyle won't correct it to VAR from >just V. I know it's a habit but there might come a time when it is >unacceptable and then you would have hoards of V's to find and fix. > >The form Timer is a low cost gizmo that runs in its own thread (just the >same way windows scheduler runs). > >Set the timer for however many milliseconds you want to check for the file. > > >----- Original Message ----- >From: "Michael J. Sinclair" <[email protected]> >To: "RBASE-L Mailing List" <[email protected]> >Sent: Monday, November 07, 2011 2:42 PM >Subject: [RBASE-L] - Copying a file to a printer from within a timer > > >Hi all, > >I want to have Rbase check for the presence of a file within a folder, and >it if finds any file, I would like Rbase to send that file to the printer >and then erase the file from the folder. > >Here is my code... > >LABEL start >SET V vchkfile = (CHKFILE('c:\main\mike.txt')) >IF vchkfile = 1 THEN >COPY c:\main\mike.txt \\servername\printername >ERASE c:\main\mike.txt >ENDIF >GOTO start >RETURN > >Here is my question... >Do I want to run the above file as a stand alone file, ie a continous loop >OR >would I be better off trying to use a TIMER EEP within a form? >I assume the form would be better because I should be able to "turn off the >code" by closing the form. >What I don't uderstand is where I need to put the EEP. Would it be a "On >Before Start EEP" or a TIMER EEP (what is the difference?) >Does it matter if I start the form with EDIT USING formname vs ENTER USING >formname? >Does the interval specify how often the EEP runs (ie I don't need the LABEL >start and GOTO start loop), or does the interval specify the time between >the moment the form is started and the time the EEP fires (in which case I >assume I would still need the LABEL start and GOTO start to make the code >keep checking the folder for files? > >I am trying to quit using Rbase for DOS (even though I love it), this will >get me one step closer! > >Any help would be great! >Mike > > > >

