Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : 2SCREEN.ZIP
Filename : 2SCREEN.PRG

 
Output of file : 2SCREEN.PRG contained in archive : 2SCREEN.ZIP

*** 2SCREEN.PRG Pans 2 screens

SET TALK OFF
USE 2SCREEN
* (SAMPLE .dbf for testing)
PRIV yrclient,sp,head1,head2,fld1,fld2
yrclient='[ABC COMPANY - PURCHASER FILE]'
sp=SPAC(2)
head1=' REC# COMPANY NAME-------------'+' CONTACT NAME--------'+' CONTACT TITLE--------- '
head2=' REC# CO NAME (ABBREV)---- '+'STREET ADDRESS--------- '+' CITY---------- ST ZIP--'
fld1='STR(RECN(),4)+sp+Co+sp+Name+sp+Titl'
fld2='STR(RECN(),4)+sp+SUBS(Co,1,20)+sp+'+'STR+sp+City+" "+St+" "+Zip'
* you customize above 6 variables

PRIV scr,sk,xkwy1,xkey2,crec,ans
scr="1"
xk=' 3, 5, 13, 18, 24, 27, 88,101,120'
xkey1=' 2, 4,'+xk
xkey2=' 19, 26,'+xk
CLEA
SET ESCAPE OFF
@ 1,0 TO 3,79 DOUBLE
@2,(40-LEN(yrclient)/2) SAY yrclient

DO WHILE .T.
@ 4,0 CLEA
@ 4,0 SAY head&scr
@ 5,0 TO 5,79
crec=RECN()
cfld=fld&scr
DISP OFF NEXT 15 &cfld
IF .NOT. EOF()
SKIP
ENDIF
@ 23,0 TO 23,79
@ 24,4 SAY IIF(EOF(),"END OF FILE","MORE: PGDN")+" PGUP"
@ 24,32 SAY IIF(SCR="1",CHR(26)+" LEFT",CHR(27)+" RIGHT")+" SCREEN"
@ 24,55 SAY "EIT OR cape "
ans=" 0"
DO WHILE .NOT. ans$xkey&scr
ans=STR(INKE(),3)
ENDDO

DO CASE
CASE ans$' 2, 4, 19, 26'
scr=IIF(ans$" 2, 4","2","1")
GOTO crec
CASE ans$' 5, 18'
GOTO crec
temp=0
DO WHIL temp<15 .AND. .NOT. BOF()
SKIP -1
temp=temp+1
ENDDO
CASE ans$' 27, 88,120' .OR. EOF()
EXIT
ENDCASE
ENDDO

USE
SET ESCAPE ON
SET TALK ON
* above 3 lines for testing only
@ 23,0 clea
RETURN