David:
Here is one more for your consideration. The quick code enclosed below will
take the number of records and display it at 2 percent increments or 50
increments for the entire set, it also displays the counter as a progress
bar (very cool). You can easily change it to display at different
increments. As you will see, when you use the CHAR(219) it displays very
neatly as a bar when using the WRITE command (great for DOS) but it shows
garbled in the message bar. I have also included a quick and dirty code that
display a message (and WRITE display) for all the character codes (one at a
time) as they are dependent (I think) on the character set that you have on
your desktop (or R prompt as set in preferences). When I have a little more
time I will fine tune it to properly display a bar, in the mean time fell
free to play with it; I believe that it will take care of the screen flicker
as well with less load on resources. I believe that I will be using this
approach for my counters as it shows not only the percentage but a good
looking progress bar.
============================================================
-- QUICK CODE TO SHOWS PERCENT AND PROGRESS BAR FOR A COUNTER
CLS
SET VAR vnr INTEGER
SET VAR vinc INTEGER
SET VAR von INTEGER
SET VAR vpct INTEGER
SET VAR vnr INTEGER
-- PAUSE 2 USING 'Counting from 1 to 10000; now on 10000' AT 5 10
SET VAR vno_recs = 10000
PAUSE 3 USING 'Counting from 1 to 10000 by 2 pct increments with .with
bargraph display' +
AT 5 10
SET VAR vinc = (.vno_recs / 50)
SET VAR vnr = .vinc
SET VAR vbar = ' '
SET VAR von = 0
SET VAR vpct = 2
WHILE von < .vno_recs THEN
SET VAR von = (.von + 1)
IF ( vnr = .von ) THEN
-- Use a character other that 62 to display a different bar style
set var vbar = ( .vbar + (CHAR(62)) )
set var vmessage = ( (CTXT(.vpct)) + ' % - ' + .vbar )
write .vmessage at 20 2
pause 4 using .vmessage
set var vpct = (.vpct + 2)
set var vnr = (.vnr + .vinc)
ENDIF
ENDWHILE
CLEAR ALL VAR
RETURN
============================================================
The following code will display a message with the different CHAR to see
which one you want to use.
============================================================
SET VAR xxx = 255
SET VAR y = 1
PAUSE 3 USING 'Counting from 1 to 10000 by 2 pct increments with .with
bargraph display' +
AT 5 10
WHILE y < .xxx THEN
set var y = .y + 1
set var z1 = (CHAR(.y))
set var z = ( (CTXT(.y)) + ' - ' +
.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+.z1+
.z1+.z1+.z1 )
PAUSE 2 using .z
WRITE .z
ENDWHILE
============================================================
Good luck,
Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln., Suite #14
Olathe, KS 66062-4571
(913)829-0888
(913)649-2904 FAX
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David M. Blocker
Sent: Friday, June 14, 2002 3:13 PM
To: [EMAIL PROTECTED]
Subject: Re: PAUSE 4 and Screen Flicker
THanks to everyone who replied!
So the final answer is:
1. The initial PAUSE 3 must be EQUAL TO OR LONGER than any subsequent PAUSE
4: PAUSE 4 will not display a message any wider than the original box and
that makes sense.
2. To avoid the flicker, set it up, as in Jim's example below, to only
refresh the box once a second to avoid the WINDOWS flickering problem.
Thanks!!
David Blocker
----- Original Message -----
From: "Jim Limburg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 1:34 PM
Subject: Re: PAUSE 4 and Screen Flicker
> David
>
> Try this snippet and watch the results. Since we only have two
> options of getting this to work time wise. Checking the result
> once a second, or on a continous effort like the code you first
> presented, but most if not all systems would never be able to
> refresh the screen fast enough for the way you were doing it.
>
> MAYBE we could get Razzak to provide us with some kind of LESS
> than a SECOND timer or a another glorious way to do this.
>
> CLS
> --PAUSE 2 USING 'Counting from 1 to 50000; now on 10000' AT 5 10
> SET VAR vm_starttime TIME
> SET VAR vm_starttime = (.#TIME)
>
> SET VAR vm_timeplussec TIME
> SET VAR vm_timeplussec = (.vm_starttime + 1)
>
> PAUSE 3 USING 'Counting from 1 to 500000; now on 0 ' AT 5 10
>
> SET VAR von = 0
> WHILE von < 500000 THEN
> SET VAR von = (.von + 1)
> SET VAR vm_starttime = (.#TIME)
> IF vm_starttime = .vm_timeplussec THEN
> --WRITE .vmessage AT 20 2
> SET VAR vmessage = ('Counting from 1 to 500000; now on'&(CTXT(.von)) )
> PAUSE 4 USING .vmessage
> SET VAR vm_timeplussec = (.vm_starttime + 1)
> ENDIF
> ENDWHILE
> CLS
> RETURN
>
> Jim Limburg
>
>
> --- "David M. Blocker" <[EMAIL PROTECTED]> wrote:
> > Razzak
> >
> > Help! What am I missing?
> >
> > I was so excited about the PAUSE 3 and PAUSE 4 that I tried to apply it
to
> > program I'm writing that needed a counter. Here is a small demo file:
> >
> > cls
> > pause 2 using 'Counting from 1 to 10000; now on 10000' at 5 10
> >
> > pause 3 using 'Counting from 1 to 10000; now on 0' at 5 10
> >
> > set var von = 0
> > while von < 10000 then
> > set var von = (.von + 1)
> > set var vmessage = ('Counting from 1 to 10000; now on'&(ctxt(.von)) )
> > write .vmessage at 20 2
> > pause 4 using .vmessage
> > endwhile
> >
> > I include the PAUSE 2 at the top for contrast. When I run this in R:Base
> > (tried it on build 1.850 and the beta, 1.854, both on a Dell Windows 98
> > portable and Dell Windows XP desktop), I get two problems:
> >
> > 1. The screen does a big time flicker with the PAUSE 4
> > 2. The counter doesn't show on the right! All I get is
> > "Counting from 1 to 10000; now on" in the box
> >
> > I include the WRITE command to show that there's nothing wrong with the
> > variable vMessage - WRITE shows the progression just fine.
> >
> > David Blocker
> >
> > ----- Original Message -----
> > From: "A. Razzak Memon" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 13, 2002 12:14 PM
> > Subject: Re: Another novice form question - Razzak's Reply
> >
> >
> > >
> > > Bob,
> > >
> > > A new option of PAUSE 4 has been added in The Glorious R:BASE
> > > 2000 (ver 6.5++) for Windows.
> > >
> > > There are cases when you would like to display any message using
> > > PAUSE 3 command and continue processing things behind the scene.
> > > If you also have to display any progress notes, etc., without flicker,
> > > now you can use the option of PAUSE 4.
> > >
> > > The new PAUSE 4 works just like PAUSE 3 except than instead of
> > > painting a new dialog box with the message it will use the existing
> > > displayed PAUSE 3 box and just redo the message inside the box.
> > > This can be used to eliminate flicker for those times when you are
> > > using PAUSE 3 to display progress in an application.
> > >
> > > Example:
> > >
> > > -- LoopD.RMD To Demonstrate the Use of PAUSE 3 and PAUSE 4
> > >
> > > CLEAR ALL VAR
> > > SET CAPTION ' '
> > > SET VAR v1 TIME
> > > SET VAR v1 = (.#Time)
> > > SET VAR v2 TIME
> > > SET VAR v2 = (.v1 + 5)
> > > SET VAR v3 TIME
> > > SET VAR v3 = (.v1 + 1)
> > > SET VAR MsgNum INTEGER = 1
> > >
> > > CLS
> > > PAUSE 3 USING 'Wait for this to quit...' CAPTION 'Demo of New PAUSE 4
> > > Option ...'
> > >
> > > WHILE v1 < .v2 THEN
> > > SET VAR v1 = (.#time)
> > > IF v1 = .v3 THEN
> > > SWITCH (.MsgNum)
> > > CASE 1
> > > PAUSE 4 USING 'Hello'
> > > BREAK
> > > CASE 2
> > > PAUSE 4 USING 'Developers ...'
> > > BREAK
> > > CASE 3
> > > PAUSE 4 USING 'Check'
> > > BREAK
> > > CASE 4
> > > PAUSE 4 USING 'This'
> > > BREAK
> > > CASE 5
> > > PAUSE 4 USING 'Out ...'
> > > BREAK
> > > ENDSW
> > > SET VAR MsgNum = (.MsgNum + 1)
> > > SET VAR v3 = (.v1 + 1)
> > > ENDIF
> > > ENDWHILE
> > > CLEAR ALL VAR
> > > RETURN
> > >
> > > For more details and examples: http://www.RSyntax.com
> > >
> > > Enjoy and make sure to have fun!
> > >
> > > Very Best Regards,
> > >
> > > Razzak.
> > >
> > > At 11:59 AM 6/13/2002 -0500, Bob Thompson wrote:
> > >
> > > >I want to display a "count down" counter
> > > >on a form while the app is processing a
> > > >somewhat large data set. I have a push button
> > > >on the form that executes the program and
> > > >I want the form to display something like :
> > > > "Processing record# 20 of 10000"
> > > >
> > > >This app may take 1-2 minutes to completely
> > > >execute and this is feed back to the user.
> > > >
> > > >I have tried the SCREEN RESTORE, WRITE
> > > >and RECALC commands, but cannot get the
> > > >form to show updated variables until the procedure
> > > >has finished. (It is then a moot point of course!)
> > > > I do not want to use the FEEDBACK option as
> > > > I would like more control over what and
> > > >how the counter is displayed.
> > > >
> > > >You all have been very helpful and I appreciate
> > > >the assistance. Again, simply how do you
> > > >get a variable to redisplay at will on a form
> > > >while you are performing a WHILE LOOP or
> > > >DECLARE CURSOR ?
> > >
> > >
> > > ================================================
> > > TO SEE MESSAGE POSTING GUIDELINES:
> > > Send a plain text email to [EMAIL PROTECTED]
> > > In the message body, put just two words: INTRO rbase-l
> > > ================================================
> > > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > > ================================================
> > > TO SEARCH ARCHIVES:
> > > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> > >
> >
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > ================================================
> > TO SEARCH ARCHIVES:
> > http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/