FoxBase+/Mac-How to rewrite screen? 
Author Message
 FoxBase+/Mac-How to rewrite screen?

I'm using FoxBase+/Mac, version 2.01.

Specific Question: How do I make a screen rewrite every two minutes
while at the same time make it so someone can interrupt with menu hit.

Background: This is part 3 of a scheduling program. Part 1 is used by
appointment office to schedule visits. Part 2 is used by receptionist
to register patients as they arrive.  Part 3 is used by providers in a
staff room to at a glance see daily schedule and whether or not
patients have arrived.  The information in the .dbf is being updated
constantly by Parts 1 and 2.  I?ve come up with the code below for
rewriting the screen:

refresh=VAL(SYS(2))
DO WHILE .T.
        IF VAL(SYS(2))>refresh+120
        [seeks .dbf for designated provider visits and rewrites screen]
        STORE VAL(sys(2)) TO refresh
        ENDIF
ENDDO

There are two problems with the way I?ve written it (probably more then
2 :-) ).  1) I want the providers to be able to interrupt with a menu
hit if they want to Change the Date they are viewing or Change the
providers? schedules they are viewing (user defined menu bar); and 2)
This is running on an SE/30 (off a file server) and I want the
providers to be able to use the computer for other things. Since this
is a constant loop, it?s slowing down the SE/30 and I?m concerned it
will slow down the file server as well.

I think the perfect solution would be a read or wait statement with a
two minute time out, but I haven't figured one out. Thanks in advance
for any help.



Sun, 19 Jan 1997 06:00:03 GMT
 FoxBase+/Mac-How to rewrite screen?

: refresh=VAL(SYS(2))
: DO WHILE .T.
:       IF VAL(SYS(2))>refresh+120
:       [seeks .dbf for designated provider visits and rewrites screen]
look for the FoxTools archive on info-mac, or on CompuServe. It includes
an XCMD that updates the screen. Failing which, I'll post you my version.
The XCMD is trivial, but one thing to beware of is that the way that
Fox handles screen forced refreshing also flushes the Fox buffers - it
can slow down a processing loop.

If you are writing serious FoxBase+/Mac code then I suggest you also
download my shareware XScrollList and XFoxEvents XCMDS from the same
sources, and have a look at the free tips I've posted on info-mac
(I'm pretty sure this is in somewhere like dev/info).

Andy Dent (A.D. Software - Mac, DOS & Windows GUI dev.)
94 Bermuda Dve, BALLAJURA  Western Australia  6066
Phone/Fax: 09 249 2719 (local)  +619 249 2719 (International)



Tue, 21 Jan 1997 21:10:59 GMT
 FoxBase+/Mac-How to rewrite screen?

: I'm using FoxBase+/Mac, version 2.01.

: Specific Question: How do I make a screen rewrite every two minutes
: while at the same time make it so someone can interrupt with menu hit.

: Background: This is part 3 of a scheduling program. Part 1 is used by
: appointment office to schedule visits. Part 2 is used by receptionist
: to register patients as they arrive.  Part 3 is used by providers in a
: staff room to at a glance see daily schedule and whether or not
: patients have arrived.  The information in the .dbf is being updated
: constantly by Parts 1 and 2.  I?ve come up with the code below for
: rewriting the screen:

: refresh=VAL(SYS(2))
: DO WHILE .T.
:       IF VAL(SYS(2))>refresh+120
:       [seeks .dbf for designated provider visits and rewrites screen]
:       STORE VAL(sys(2)) TO refresh
:       ENDIF
: ENDDO

: There are two problems with the way I?ve written it (probably more then
: 2 :-) ).  1) I want the providers to be able to interrupt with a menu
: hit if they want to Change the Date they are viewing or Change the
: providers? schedules they are viewing (user defined menu bar); and 2)
: This is running on an SE/30 (off a file server) and I want the
: providers to be able to use the computer for other things. Since this
: is a constant loop, it?s slowing down the SE/30 and I?m concerned it
: will slow down the file server as well.

: I think the perfect solution would be a read or wait statement with a
: two minute time out, but I haven't figured one out. Thanks in advance
: for any help.

if this is just for viewing,  
        then use a browse nowait.
        set refresh 120  &&< number of secondsin 2 min>

This will take the user machine out of a looping state.  
the loop only effects the user machine not the server except at
2 min interval.  also open the files in a view only mode. change mode if the
provider changes to update an entry.

Another possibility is a read timeout 120 on a screen.
in the screen leave a valid which sets the valut of llexit to .t.
(initialized as .f.)

in the read valid of the screen put
if llexit
        llretval = .t.
else
        &&do the sql statement here--  
endif

*other events can be checked here as well, like another read level which is
*an entry screen for changing data,  menu event handler,, etc

return llretval

if llretval is .t. read valid returns .t. and the read terminates
otherwise the dbf is querried again.

also look at examples of  foundation reads.

Hope this helps
--
Steven Finkelman
DATA/Massage                                            



Tue, 28 Jan 1997 05:59:04 GMT
 FoxBase+/Mac-How to rewrite screen?
I've been using FOXBASE/MAC for several years and to my knowledge you
can not read with a time out.  Also, since you are not in a read/wait
state, the menu bar is not active.

However, since you want to continuously update with out the user
having to do anything, a possible solution is to use the INKEY() function.

DO WHILE .T.
       [seeks .dbf for designated provider visits and rewrites screen]
       MKEY = INKEY(120)

       IF MKEY # 0
         MKEY = UPPER(CHR(MKEY))

         DO CASE
           CASE MKEY == "D" && CHANGE DATE
             && CHANGE DATE ROUTINE
           CASE MKEY == "S" && CHANGE SCHEDULE
             && CHANGE SCHEDULE ROUTINE
           OTHERWISE
             && UPDATE
         ENDCASE

       ENDIF

ENDDO

Instead of using the menu bar the user will click a key instead.
The inkey will time out after 120 seconds and update the screen.
Or the user will click a key.  Instructions on the screen will
tell the user what to click.  Accidently clicking another key
just results in an update.  This shouldn't slow your server down
either since it is only happening once every two minutes.

Let me know if it works for you,

Mark



Thu, 30 Jan 1997 11:57:40 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Screen redraw in Foxbase+/Mac

2. porting from FoxBASE+/Mac to FoxPro/Mac?

3. Need help for running Foxbase+/mac 2.01 to MAC OS 9

4. Help with Foxbase+/Mac

5. Help with Foxbase+/Mac

6. Help with Foxbase+/Mac

7. FoxBASE+/Mac 2.01: HELP!!

8. FoxBASE+/Mac 2.01 -- HELP!

9. foxbase+/Mac Book

10. foxbase+ mac printer switch

11. The last version of FoxBASE+/Mac (legacy db)?

12. FoxBASE+/mac App update


 
Powered by phpBB® Forum Software