ƒZ i j CMD_FUNCT ?C€ƒ  Ùá# ?S €ƒn}EXECUTE T ?C€ƒ ,Ùá# ?S €ƒn}MEMO TE T ?M€ƒ Ùá# ?S €ƒn}COMMAND T ?C€ƒ # Ùá# ?S €ƒn}SEQUENCE ?C€ƒ  Ùá# ?S €ƒn}PAGE NCE ?C€ƒ Ùá# ?S €ƒn}USE_RCRD ?N€ƒ  Ùá# ?S €ƒn} A 2THE DCLIP TUTOR 1 12- 1-DC 1 A 4COMMANDS 1 C 5- 1 0 A 6COMMANDS 2 C 5- 2 0 A 8COMMANDS 3 C 5- 3 0 A 10COMMANDS 4 C 5- 4 0 Cset proc to rm,memoedit(memoread('read.me')); RM; wait 11 C 5- 9 0 Cset batch to demo,demo; demo 12 C 5- 9 0 Cclear; close all; use baseball; declare fields[fcount()]; AFIELDS(FIELDS); field_name=ACHOICE(10,10,15,20,FIELDS); ?FIELD(FIELD_NAME); wait 13 C 5- 10 0 CA=10; B=20; C=A*B; D=SQRT(C); ? a,b,c,d; wait 14 = C 5- 11 0 C? 'Hello World'; wait 15? C 5- 13-DC 0 Ca=1; clear; set mess to 15; set echo off; set cons off; @ 10,1 PROM 'Menu 1' MESS 'Do menu 1'; @ 11,1 PROM 'Menu 2' MESS 'Do menu 2'; @ 12,1 PROM 'Menu 3' MESS 'Do menu 3'; MENU TO a; set echo on; set cons on; ? a; wait 16@ PROMPT C 5- 16 0 Cset echo off; set cons off; clear; num=0; @ 10,12 SAY 'ENTER A NUMBER FROM 25-60 ' GET NUM PICT '99' RANGE 25,60; read; set echo on; set cons on; ? num; wait 17@ SAY C 5- 17 0 Cclear; @ 10,10 TO 15,20; @ 9,30 TO 14,50 DOUBLE; wait 18@ TO C 5- 19 0 Cclear; ACCEPT 'Enter a string ' TO string; ? string; wait 19ACCEPT C 5- 19 0 Cclose all; use baseball; copy to junk; use junk ; APPEND 20APPEND C 5- 20 0 Cclose all; use baseball; copy to junk; use junk; ? reccount(); APPEND BLANK; APPEND BLANK; ? reccount(); wait 21APPEND BLANK C 5- 20 0 Cclose all; use baseball; copy stru to junk; use junk; APPEND FROM BASEBALL FOR LEAGUE='NL'; ?reccount(); wait 22APPEND FROM C 5- 21 0 Cclose all; use sales; AVERAGE EXPENSES TO _EXPENSES FOR YEAR='1986'; ?_expenses; wait 23AVERAGE C 5- 24 0 CBATCH DEMO 24BATCH C 5- 25 0 CCHR 25CHR C 5- 28 0 Ccurdir=dc_curpath(); CD.. ; wait; CD DCLIP25; wait 26CD C 5- 28 0 CCLEAR; wait; a='this is a get (press enter)'; @ 10,10 get a; wait; CLEAR SCREEN; READ 27CLEAR [SCREEN] C 5- 29 0 CKEYBOARD ' this is a test'; CLEAR TYPEAHEAD; wait 28CLEAR TYPEAHEAD C 5- 30 2 CCLEAR; a='get 1'; b='get 2'; set cons off; @ 10,10 get a; @ 11,10 get b; CLEAR GETS; c='get 3'; d='get 4'; @ 12,10 get c; @ 13,10 get d; read; set cons on; wait 29CLEAR GETS C 5- 30 0 CCLOSE ALL; use baseball index player; ? alias(),indexkey(0); wait; CLOSE INDEX; ? alias(),indexkey(0); wait; CLOSE DATABASES; ? alias(),indexkey(0); wait 30CLOSE C 5- 31 0 CCOLOR; wait 31COLOR C 5- 32 0 CCOLOR SETUP; wait 32COLOR SETUP C 5- 33 0 Cclose all; use baseball; copy stru to junk; use junk; append blank; dir junk.dbf; wait; COMMIT; dir junk.dbf; wait 33COMMIT C 5- 34 0 Cclose all; use baseball; locate for position='1B'; ?player,team,position; wait; CONTINUE; ?player,team,position; wait; CONTINUE; ? player,team,position; wait 34CONTINUE C 5- 34 0 Cclose all; use baseball; COPY TO JUNK FOR POSITION='1B'; use junk; list player,team,position; wait 35COPY C 5- 35 0 Cdir read*.*; wait; COPY FILE READ.ME TO README.2; dir read*.*; wait; erase readme.2 36COPY FILE C 5- 37 0 Cclose all; use baseball; COPY STRUCTURE TO JUNK; use junk; display structure 37COPY STRUCTURE C 5- 38 0 Cclose all; use baseball; COPY STRUCTURE EXTENDED TO JUNK; use junk; list; wait 38COPY STRUCTURE EXTENDED C 5- 38 0 Cclose all; use baseball; COUNT FOR POSITION='1B' .AND. LEAGUE='NL' TO NL1B; ? nl1b; wait 39COUNT C 5- 39 0 Cclose all; CREATE JUNK; display structure 40CREATE C 5- 40 0 Cclose all; use baseball; copy stru exte to junk; use junk; list; close; wait; CREATE JUNK2 FROM JUNK; use junk2; display structure 41CREATE FROM C 5- 40 0 Cclear; DECLARE ELEMENTS[5]; elements[1]=125.67; elements[2]=date(); elements[3]=time(); elements[4]=.t.; display array elements; wait 42DECLARE C 5- 41 0 Cclose all; use baseball; copy to junk; use junk; DELETE FOR POSITION='1B'; list player,team,position,iif(deleted(),'**deleted**',''); wait 43DELETE C 5- 42 0 Cclear; DIR; wait; clear; DIR DC*.*; wait 44DIR C 5- 43 0 Cclose all; use baseball; DISPLAY NEXT 10 TEAM,PLAYER,POSITION FOR LEAGUE='NL'; wait 45DISPLAY C 5- 44 0 Cclear; DISPLAY ARRAY _D_C_COLOR; myarray = array(3,4,5); DISPLAY ARRAY MYARRAY; DISPLAY ARRAY MYARRAY[2]; DISPLAY ARRAY MYARRAY[3][2]; wait 46DISPLAY ARRAY C 5- 45 0 Cclear; string='this is string'; number=12345.67; date=DATE(); logical=.t.; screen=SAVESCREEN(10,10,20,20); DISPLAY MEMORY; wait 47DISPLAY MEMORY C 5- 46 0 Cclear; string='this is string'; number=12345.67; date=DATE(); logical=.t.; screen=savescreen(10,10,20,20); save to junk; DISPLAY MEMORY FILE JUNK; wait 48DISPLAY MEMORY FILE C 5- 47 0 Cclose all; key load; set batch to demo,demo; set proc to br,DC_BROWSE(); use baseball index team,player; set filter to league='NL'; sele 5; use sales; set rela to year into baseball; DISPLAY STATUS; wait 49DISPLAY STATUS C 5- 49 0 Cclose all; use baseball; DISPLAY STRUCTURE 50DISPLAY STRUCTURE C 5- 52 0 Cclose all; use baseball; copy to junk; use junk; EDIT 51EDIT C 5- 56 0 CEDIT FILE READ.ME; EDIT READ.ME; EDIT READ.ME 30 52EDIT FILE C 5- 57 0 Cclos all; use baseball; copy structure extended to temp; use temp; append blank; replace field_name with 'memo1'; replace field_type with 'M'; use; create junk from temp; use junk; append blank; repl memo1 with 'junk text'; EDIT MEMO; ?memo1; wait 53EDIT MEMO C 5- 58 0 CEJECT 54EJECT C 5- 59 0 Ccopy file baseball.dbf to junk.dbf; dir junk.dbf; wait; ERASE FILE JUNK.DBF; dir junk.dbf; wait 55ERASE/DELETE FILE C 5- 59 0 Cclose all; use baseball index player; FIND Foster; ? team,player,position; wait 56FIND C 5- 60 0 Cclose all; use baseball; GOTO 10; ? recno(),team,player,position; wait 57GO/GOTO C 5- 61 0 Cclose all; use baseball; INDEX ON POSITION TO POSITION; set index to position; list player,team,position,recno(); wait 58INDEX C 5- 67 0 CINKEY 59INKEY C 5- 69 0 Cclos all; use baseball; copy to junk; use junk; goto 5; INSERT 3; repl player with 'INSERT 1'; skip; repl player with 'INSERT 2'; skip; repl player with 'INSERT 3'; go top; list player,team; wait 60INSERT C 5- 70 0 Cclear; INPUT 'ENTER A NUMBER ' TO NUMBER; ? number; wait 61INPUT C 5- 71 0 Cclose all; use baseball; sele 0; use sales; JOIN WITH BASEBALL TO JUNK FOR BASEBALL->POSITION='1B' .AND. YEAR='1986'; use junk; browse 62JOIN C 5- 72 0 Cclear; string=space(30); set typeahead to 20; set echo off; KEYBOARD ' Hello from the tutor'; set console off; @ 10,10 say 'Enter a string' GET string; read; set echo on; set cons on 63KEYBOARD C 5- 73 0 Cclose all; clear; use baseball; LABEL FORM BASEBALL; wait 64LABEL FORM C 5- 80 0 Cclose all; use baseball; LIST TEAM,PLAYER,POSITION FOR LEAGUE='NL'; wait; LIST OFF PLAYER,ORIG_PRICE,PRES_VALUE,PRES_VALUE-ORIG_PRICE; wait; LIST PLAYER,PRES_VALUE FOR PRES_VALUE>.50; wait 65LIST C 5- 84 0 Cclose all; use sales; LIST STRUCTURE 66LIST STRUCTURE C 5- 85 0 Cclose all; use baseball; LOCATE FOR PRES_VALUE>1.50 .AND. LEAGUE='NL'; ? recno(),player,team,league,pres_value; wait 67LOCATE C 5- 86 0 Cset message to 15; set cons off; clear; a=1; @ 10,10 prom 'Menu 1' mess 'Do menu 1'; @ 11,10 prom 'Menu 2' mess 'Do menu 2'; @ 12,10 prom 'Menu 3' mess 'Do menu 3'; MENU TO A; set cons on; ? a; wait 68MENU TO C 5- 92 0 CMODIFY COMMAND DEMO.PRG 69MODIFY COMMAND C 5- 93 0 Cclose all; use baseball; copy to junk; use junk; MODIFY STRUCTURE; display structure 70MODIFY STRUCTURE C 5-102 0 Cclose all; use baseball; copy to junk; use junk; ? reccount(); dele for position='1B'; PACK; ? reccount(); wait 71PACK C 5-105 0 Cproc clear; PROC DEMO; set step on; do demo; PROC CALC; set step on; do demo 72PROC C 5-106 0 CPROC CLEAR; proc demo; proc calc; proc graph; proc grsubtot; proc; wait; ; ; PROC CLEAR 3; proc; wait; ; ; PROC CLEAR; proc; wait 74PROC CLEAR C 5-107 0 Cclose all; use baseball; QUERY MY_QUERY; my_query=iif(empty(my_query),'.t.',my_query); loca for &my_query; disp; wait 75QUERY C 5-110 0 Cstore space(15) to get1,get2,get3; set echo off; set cons off; clear; @ 10,10 say 'This is get 1' get get1; @ 11,10 say 'This is get 2' get get2; @ 12,10 say 'This is get 3' get get3; READ; set echo on; set cons on; ? get1,get2,get3; wait 76READ C 5-113 0 Cclose all; use baseball; copy to junk; use junk; delete for league='NL'; count for deleted() to del; ? del; wait; RECALL FOR position='1B'; count for deleted() to del; ? del; wait 77RECALL C 5-114 0 Cclose all; use baseball index team,player; REINDEX 78REINDEX C 5-116 0 Cjunk1='junk'; junk2='more junk'; string1='string'; string2='another string'; num1=123.45; num2=444.88; disp memo; wait; clea; RELE ALL LIKE JUNK*; disp memo; wait; clea; RELE STRING1; disp memo; wait 79RELEASE C 5-117 0 Cset defa to; copy file demo.prg to junk.prg; dir junk.prg; wait; RENAME JUNK.PRG TO NEWJUNK.PRG; dir newjunk.prg; wait 80RENAME C 5-118 0 Cclose all; use baseball; copy to junk; use junk; goto 10; ? player,team; REPLACE TEAM WITH 'MARINERS'; ? player,team; wait; REPLACE TEAM WITH 'MARINERS' FOR TEAM='DODGERS'; list team,player; wait 81REPLACE C 5-119 0 Cclose all; use baseball; REPORT FORM BASEBALL FOR LEAGUE='NL'; wait 82REPORT FORM C 5-121 0 Crelease all; string='this is a string'; date=DATE(); number=123.45; display memory; wait; save to junk; release all; display memo; wait; RESTORE FROM JUNK ADDITIVE; display memory; wait 83RESTORE C 5-123 0 Crelease all; string='this is a string'; date=DATE(); number=123.45; display memory; wait; SAVE TO JUNK; release all; display memory; wait; restore from junk additive; display memory; wait 84SAVE C 5-123 0 Cclose all; SELECT 5; use baseball; SELECT 0; use sales; wait; display status; wait; SELECT BASEBALL; wait 85SELECT C 5-123 0 Cclear; dc_expl(5,10,20,70,' this is a box '); save screen to oldscreen; wait; clear; wait; RESTORE SCREEN FROM OLDSCREEN; wait 86RESTORE SCREEN C 5-124 0 Cclear; dc_expl(5,10,20,70,' this is a box '); SAVE SCREEN TO OLDSCREEN; wait; clear; wait; restore screen from oldscreen; wait 87SAVE SCREEN C 5-124 0 Csave set to junk; display status; set defa to \temporary; set cursor off; set path to \temppath; set color to w+/r; disp stat; wait; RESTORE SET FROM JUNK; disp stat; wait 88RESTORE SET C 5-125 0 CSAVE SET TO JUNK; display status; set defa to \temporary; set cursor off; set path to \temppath; set color to w+/r; disp stat; wait; restore set from junk; disp stat; wait 89SAVE SET C 5-125 0 CSEARCH * DCLIP; SEARCH BASEBALL ROSE 90SEARCH C 5-130 0 Cclose all; use baseball index team; SEEK 'REDS'; ? team,player,position; wait 91SEEK C 5-132 0 CSET DEFA; SET PATH; SET CURSOR; SET CONFIRM; wait 92SET C 5-134 0 CSET ALTERNATE TO JUNK.ALT; SET ALTERNATE ON; set print on; ? 'This is a test'; ? 'This is more testing'; set print off; SET ALTERNATE OFF; SET ALTERNATE TO; type junk.alt; wait 93SET ALTERNATE C 5-135 0 CSET BATCH TO demo,demo 94SET BATCH C 5-136 0 CSET BELL ON; set echo off; set cons off; c=' '; clear; @ 10,10 SAY 'Bell is ON, Enter key' get c; read; SET BELL OFF; @ 12,10 say 'Bell is OFF, enter key' get c; read; set cons on 95SET BELL C 5-137 0 CSET CENTURY OFF; set echo off; set cons off; d=date(); clear; @ 10,10 SAY 'Century is OFF, Enter a date' get d; read; SET CENTURY ON; @ 12,10 say 'Century is ON, enter a date' get d; read; set cons on; set echo on 96SET CENTURY C 5-137 0 Coldcolor=setcolor(); SET COLOR TO GR+; ? 'This is yellow'; SET COLOR TO W+*/G; ? 'This is blinking white on green'; SET COLOR TO &oldcolor; ? 'This is our original color'; wait 97SET COLOR C 5-139 0 CSET COMMAND TO DW,DIR /W,50,C:; dw; wait 98SET COMMAND C 5-140 0 C SET CONSOLE ON; ? 'this should go to the screen'; ? 'this should go to the screen too'; wait; SET CONSOLE OFF; ? 'this should not go to the screen'; wait; SET CONSOLE ON 99SET CONSOLE C 5-141 0 CSET CURSOR ON; ? 'The cursor is ON'; wait; SET CURSOR OFF; ? 'The cursor is OFF'; wait; SET CURSOR ON 100SET CURSOR C 5-142 0 Cclear; SET DATE GERMAN; ?date(); SET DATE ITALIAN; ?date(); SET DATE ANSI; ?date(); SET DATE BRITISH; ?date(); SET DATE FRENCH; ?date(); SET DATE AMERICAN; ?date(); wait 101SET DATE C 5-142 0 Cset fixed on; number=123.4567; SET DECIMALS TO 2; ? number; wait; ; ; SET DECIMALS TO 5; ? number; wait; set fixed off 102SET DECIMALS C 5-144 0 Cdefault=dc_sett('defa'); SET DEFAULT TO; dir; wait; SET DEFAULT TO C:\; dir; wait; SET DEFA TO &DEFAULT 103SET DEFAULT C 5-144 0 Cclose all; use baseball; copy to junk; use junk; dele for position='1B'; SET DELETED OFF; list team,player,position; wait; SET DELETED ON; list team,player,position; wait; SET DELETED OFF 104SET DELETED C 5-145 0 Cclear; c=space(10); SET DELI ON; SET DELI TO '[]'; set cons off; set echo off; @ 10,10 say 'Delimeters are [] ' GET c; read; SET DELI OFF; @ 12,10 say 'Delimeters are off ' get c; read; set cons on; set echo on; SET DELI OFF 105SET DELIMETERS C 5-146 0 CSET DEVICE TO SCREEN; 10,10 say 'This goes to the screen'; SET DEVICE TO PRINT; @ 12,10 say 'This goes to the printer'; wait 106SET DEVICE C 5-147 0 CSET ECHO ON 107SET ECHO C 5-148 0 Cclear; e=' '; SET ESCAPE ON; set echo off; set cons off; @ 10,10 say 'Escape is ON, Press ESC' get e; read; SET ESCAPE OFF; @ 12,10 say 'Escape is OFF, Press ESC ' get e; read; SET ESCAPE ON; set cons on; set echo on 108SET ESCAPE C 5-149 0 Cclear; A='12345'; B='123'; SET EXACT OFF; ? A = B; wait; ; ; SET EXACT ON; ? A = B; wait; SET EXACT OFF 109SET EXACT C 5-150 0 Cclear; SET EXCLUSIVE ON; use baseball; pack; wait; ; ; ; SET EXCLUSIVE OFF; use baseball; pack; wait; SET EXCLUSIVE ON 110SET EXCLUSIVE C 5-151 0 Cclear; close all; use baseball; SET FILTER TO LEAGUE='NL'; list team,player,league; wait; ; ; SET FILTER TO; list team,player,league; wait 111SET FILTER C 5-152 0 Cclear; SET FIXED ON; number=123.4567; set decimals to 5; ? number; wait; ; ; set decimals to 2; ? number; wait; ; ; SET FIXED OFF; ? number; wait 112SET FIXED C 5-153 0 Cclear; f=space(10); set defa to; memowrit('junk.prg','@ 10,10 say "This is from junk.prg format file " get f'+chr(13)+chr(10)); make junk; SET FORMAT TO JUNK; clear; read 113SET FORMAT C 5-154 0 Cclear; SET FUNCTION 2 TO ' This is the stuff I put into function key 2'; accept 'Press key F2 now...' to junk; wait; SET FUNC 2 TO 114SET FUNCTION C 5-155 0 Cclear; close all; use baseball; list team,player; wait; SET INDEX TO TEAM; list team,player; wait; SET INDEX TO PLAYER; list team,player; wait 115SET INDEX C 5-156 0 Ca=space(10); clear; SET INTE ON; set echo off; set cons off; @ 10,10 say 'Intensity is ON' get a; read; SET INTE OFF; @ 12,10 say 'Intensity is OFF ' get a; read; set cons on; set echo on; SET INTE ON 116SET INTENSITY C 5-157 0 Cobj demo1; SET KEY -1 TO CALC; wait 'Press key F2 now...'; SET KEY -1 TO 117SET KEY C 5-158 0 Cclear; set printer to junk.prn; set print on; SET MARGIN TO 10; ? 'The margin is now 10'; SET MARGIN TO 25; ? 'The margin is now 25'; set print off; set printer to LPT1; type junk.prn; wait; SET MARGIN TO 0 118SET MARGIN C 5-159 0 Ca=1; clear; SET MESS TO 15 CENTER; set echo off; set cons off; @ 10,1 prom 'Menu 1' mess 'Do menu 1'; @ 11,1 prom 'Menu 2' mess 'Do menu 2'; @ 12,1 prom 'Menu 3' mess 'Do menu 3'; menu to a; set echo on; set cons on; ? a; wait 119SET MESSAGE C 5-159 0 Cclear; close all; use baseball index team,player; list team,player,league; wait; SET ORDER TO 2; list team,player,league; wait; SET ORDER TO 0; list team,player,league; wait 120SET ORDER C 5-160 0 Cclear; close all; SET PATH TO; cd \; use baseball; wait; SET PATH TO \DCLIP25; use baseball; wait; cd \dclip25 121SET PATH C 5-160 0 Cclear; set printer to junk.prn; SET PRINT ON; ? 'This goes to the printer'; SET PRINT OFF; ? "This doesn't go to the printer"; set printer to LPT1; type junk.prn; wait 122SET PRINT C 5-161 0 Cclear; SET PRINTER TO JUNK.PRN; set print on; ? 'This goes to the printer'; set print off; SET PRINTER TO LPT1; type junk.prn; wait 123SET PRINTER TO C 5-162 0 Cclear; SET PROCEDURE TO MEMO,MEMOWRIT('MEMOS.TXT',MEMOEDIT(MEMOREAD('MEMOS.TXT'),3,0,15,79)); ? 'Editing memos.txt. Press Ctrl-w to Save, Escape to Abort'; memo 124SET PROCEDURE TO C 5-163 0 CSET PROMPT OFF; wait; SET PROMPT ON; wait 125SET PROMPT C 5-164 0 Cclear; sele dctutor; set order to 2; sele 0; use dchelp; SET RELATION TO COMMAND INTO DCTUTOR; loca for command='SET PROMPT'; sele dctutor; ? command; ? memo; ? execute; wait 126SET RELATION C 5-165 0 Ca=' '; clear; SET SCORE ON; set cons off; set echo off; @ 10,10 say 'Scoreboard is ON, Press INSERT' get a; read; SET SCORE OFF; @ 12,10 say 'Scoreboard is OFF, Press INSERT' get a; read; SET SCORE ON; set cons on; set echo on 128SET SCOREBOARD C 5-166 0 Cclear; close all; use baseball index player; SET SOFTSEEK OFF; seek 'ABC'; ? player,team,position; wait; SET SOFTSEEK ON; seek 'ABC'; ? player,team,position; SET SOFTSEEK OFF 129SET SOFTSEEK C 5-167 0 C 130SET TYPEAHEAD C 5-171 0 Cclear; close all; use baseball; set index to team; list team,player; wait; SET UNIQUE ON; index on team to junk; set index to junk; list team,player; wait 131SET UNIQUE C 5-171 0 Ca=1; clear; SET WRAP ON; set echo off; set cons off; @ 10,1 prom 'Menu 1'; @ 11,1 prom 'Menu 2'; @ 12,1 prom 'Menu 3'; menu to a; set echo on; set cons on; ? a; wait 132SET WRAP C 5-172 0 Cclear; close all; use baseball; SORT ON PRES_VALUE TO JUNK; use junk; list team,player,pres_value; wait 133SORT C 5-174 0 Cclear; close all; use baseball; ? recno(),team,player; SKIP; ? recno(),team,player; SKIP 5; ? recno(),team,player; SKIP -2; ? recno(),team,player; wait 134SKIP C 5-175 0 Cclear; STORE 'abcde ' TO a,b,c,d,e; STORE 100 to n1,n2,n3,n4; ? a,b,c,d,e,n1,n2,n3,n4; wait 135STORE C 5-178 0 Cclear; close all; use baseball; SUM ORIG_PRICE,PRES_VALUE TO PRICE,VALUE FOR LEAGUE='AL'; ? 'Total original price: '+ ALLTRIM(STR(price)); ? 'Total present value : '+ ALLTRIM(STR(value)); wait 136SUM C 5-179 0 Cclear; close all; use baseball index team; TOTAL ON TEAM FIELD PRES_VALUE TO JUNK; use junk; list team,pres_value; wait 137TOTAL C 5-180 0 Cclear; TYPE READ.ME; wait 138TYPE C 5-186 0 Cclear; close all; use baseball; copy to junk; set excl off; use junk; repl team with 'ASTROS'; dc_reclock(); replace team with 'ASTROS'; UNLOCK; wait; set excl on 139UNLOCK C 5-186 0 Cclear; close all; USE SALES; browse; sele 0; USE BASEBALL INDEX TEAM,PLAYER ALIAS BBCARDS; browse; USE; wait 140USE C 5-188 0 Cclear; close all; use baseball; copy to junk; UTILITIES; UTILITIES C 141UTILITIES C 5-189 0 Cclear; close all; use baseball; VIEW 142VIEW C 5-190 0 CWAIT; WAIT 'Press a key to go back to the tutor...' 143WAIT C 5-195 0 Cclear; close all; use baseball; copy to junk; use junk; list team,player; ZAP; list team,player; wait 144ZAP C 5-198 0 Fstring='this is a string'; number=123.456; date=date(); logical=.t.; box=dc_expl(5,10,20,70,' this is a box '); DC_LOG(); edit dclip.log 145DC_LOG() FD 6- 76 0 Z 146FUNCTIONS 1 F 6- 1 0 Z 148FUNCTIONS 2 F 6- 2 0 Fclear; close all; set exclusive off; use baseball; copy to junk; use junk; ? reccount(); DC_ADDREC(); unlock; ? reccount(); wait 150DC_ADDREC() FD 6- 10 0 Fclear; close all; use baseball; copy to junk; set exclusive off; use junk; go 5; display; DC_BLANK(); display; wait; set exclusive on 151DC_BLANK() FD 6- 11 0 Fset defa to; clear; close all; use baseball; ?DC_BROWSE(); wait; DC_BROWSE(.T.,'','TEAM','PLAYER'); memowrit('myudf.prg','@ 0,0 say time()'+chr(13)+chr(10)); make myudf; obj myudf; DC_BROWSE(.F.,'MYUDF') 152DC_BROWSE() FD 6- 12 0 Fclear; curpath=dc_curpath(); DC_CHDIR('..'); dir; wait; DC_CHDIR(curpath); dir; wait 153DC_CHDIR() FD 6- 14 0 Fclear; ? DC_CHRSEL(); wait; ? DC_CHRSEL(176); wait 154DC_CHRSEL() FD 6- 15 0 Fclear; DC_CLRARR(.t.); wait 155DC_CLRARR() FD 6- 17 0 F? DC_CLRSEL(); wait; ? DC_CLRSEL(2); wait 156DC_CLRSEL() FD 6- 19 0 Fclear; COLOR_MON=.T.; ? DC_COLOR('W+/R')+'This is red'; COLOR_MON=.F.; ? DC_COLOR('W+/G')+'If COLOR_MON were .true. this would be green'; wait; COLOR_MON=.T. 157DC_COLOR() FD 6- 21 0 F? DC_CONMEM(); obj rele all; ? DC_CONMEM(); wait 158DC_CONMEM() FD 6- 22 0 Fclear; close all; DC_CREATE('JUNK'); use junk; display structure; wait 159DC_CREATE() FD 6- 25 0 Fclear; ? DC_CURPATH(); ? DC_CURPATH('C:'); wait 160DC_CURPATH() FD 6- 26 0 Fclear; close all; use baseball; DC_DBCH(5,15,20,65,'Press enter to pick a player',' Player Name Team',' Baseball Players ','','','','','','PLAYER','TEAM','','',20,42,0,0); ? player; wait 161DC_DBCH() 1 of 3 FD 6- 27 0 Fclear; use baseball; index on upper(player) to player; DC_DBCH(5,15,20,65,'',' Player Name Team',' Baseball Players ','','','','','','PLAYER','TEAM','','',20,42,0,0,.t.,.t.,.f.,.t.); ? player; wait 162DC_DBCH() 2 of 3 FD 6- 27 0 Fclear; use baseball; index on league to league; seek 'NL'; DC_DBCH(5,15,20,65,'Press enter to pick a player',' Player Name Team',' Baseball Players ','','','','','','PLAYER','TEAM','','',20,42,0,0,.t.,.t.,.f.,.f.,'NL','LEAGUE'); ? player; wait 163DC_DBCH() 3 of 3 FD 6- 27 0 Fclear; close all; ? DC_DBFILE('','BASEBALL'); ? alias(); wait; ? DC_DBFILE('','JUNKFILE',.t.) 164DC_DBFILE() FD 6- 32 0 Fclose all; use baseball; ? DC_DBINDEX('','TEAM'); ? DC_DBINDEX('','JUNKFILE','LEAGUE',.t.) 166DC_DBINDEX() FD 6- 33 0 Fclear; close all; use baseball; select 0; use sales; ? DC_DBSEL('JUNK'); wait; ? DC_DBSEL('BASEBALL'); wait 167DC_DBSEL() FD 6- 34 0 Fclear; close all; use baseball; ? DC_DBSTRU(); clear; ? DC_DBSTRU(10,20,.t.) 168DC_DBSTRU() FD 6- 35 0 Fclear; close all; use baseball; DC_DBSTRUW(10,16); wait 169DC_DBSTRUW() FD 6- 37 0 Fclear; close all; use baseball; declare fields[fcount()]; afields(fields); DC_DISPARR('fields'); wait; DC_DISPARR('fields','ARRAY.TXT'); type array.txt; wait 170DC_DISPARR() FD 6- 39 0 Fclear; store 'testing' to a,b,c,d,e,f,g; num=123; date=date(); time=time(); logical=.t.; DC_DISPMEM(); wait; DC_DISPMEM('','MEMORY.TXT'); type memory.txt; wait 171DC_DISPMEM() FD 6- 40 0 Fclear; key_char=''; key_num=0; @ 10,10 SAY 'Press a key'; DC_DISPTM(12,10,'key_num','key_char',.t.); ? key_num, key_char; wait 172DC_DISPTM() FD 6- 41 0 Fobj release all; rename demo.obj to demo.old; DC_DO('DEMO'); rename demo.old to demo.obj; DC_DO('DEMO') 173DC_DO() FD 6- 42 0 FDC_DOT() 174DC_DOT() FD 6- 44 0 Fclear; close all; use baseball; copy to junk; use junk; DC_EDIT(); clear; wait; DC_EDIT(.T.); clear 175DC_EDIT() FD 6- 46 0 Fclear; set console off; scrn=DC_EXPLODE(5,10,9,40,'GR+','GR+',.F.,'this is the title',30); wait; DC_IMPLODE(scrn); set console on; wait 176DC_EXPLODE() FD 6- 49 0 Fclear; close all; use baseball; sele 0; use sales; set rela to year into baseball; ? DC_FIELDS(); wait; ? DC_FIELDS(10,'ND'); wait 177DC_FIELDS() FD 6- 50 0 Fclear; close all; use baseball; copy to junk; set excl off; use junk; replace league with 'xx' for league='NL'; wait; ? DC_FILOCK(); replace league with 'xx' for league='NL'; list team,league; unlock; wait 178DC_FILOCK() FD 6- 52 0 Fclear; string='abcdefgh'; string=DC_GETVAR('string'); wait 179DC_GETVAR() FD 6- 58 0 FDC_HELP('ACHOICE'); wait; DC_HELP(); DC_HELP('COPY'); wait 180DC_HELP() FD 6- 60 0 Fclear; set console off; scrn=dc_explode(5,10,15,60,'GR+','GR+',.F.,'this is the title',10); wait; DC_IMPLODE(scrn); set console on; wait 181DC_IMPLODE() FD 6- 61 0 FDC_INIT() 182DC_INIT() FD 6- 65 0 Fclear; use dckey; copy to junk; use junk; goto 2; repl fkey_cont with 'DEMO'; repl fkey_code with 'P'; close; dc_keyload('junk'); obj demo; ? 'Press key F2 to run demo'; ? DC_INKEY('',10); wait 183DC_INKEY() FD 6- 66 0 Fclear; close all; use baseball; copy to junk; use junk; goto 6; ? reccount(); DC_INSERT(5); ? reccount(); list team,player,league; wait; DC_INSERT() 184DC_INSERT() FD 6- 67 0 Freadme=memoread('read.me'); DC_MEMO('README',5,10,20,70,.T.,.T.,.T.,'D','','N/W','W+/RB',.T.,.F.,' THIS IS THE READ.ME FILE ',.F.); memowrit('read.me',readme); wait 185DC_MEMO() FD 6- 80 0 Fclose all; use dctutor; copy to junk while recno()<20; use junk; DC_MEMOIMP() 186DC_MEMOIMP() FD 6- 84 0 Fclear; close all; set exclusive off; DC_NETUSE('BASEBALL',.t.,5); ? alias(); pack; wait 187DC_NETUSE() FD 6- 85 0 Fclear; close all; use baseball; copy to junk; use junk; DC_MODSTRU(); disp stru 188DC_MODSTRU() FD 6- 86 0 Fclear; set printer to junk.txt; DC_MPRINT("MEMOREAD('DEMO.PRG')",8,55,.t.,'Source for DEMO.PRG'); set printer to LPT1; type junk.txt; wait 189DC_MPRINT() FD 6- 88 0 Fclear; close all; use dctutor; copy to junk while recno()<20; use junk; go 10; replace memo with memo+memoread('read.html'); close; dir junk.dbt; wait; use junk; DC_PACK(); use; dir junk.dbt; wait 190DC_PACK() FD 6- 97 0 Fclear; close all; use baseball; REPORT FORM BASEBALL WHILE DC_PREADY(.t.,.t.) TO PRINT; wait 191DC_PREADY() FD 6- 98 0 Fclear; wait 'Take your printer off-line...'; ? DC_PRTEST(); wait 'Put your printer back on line...'; ? DC_PRTEST(); wait 192DC_PRTEST() FD 6- 99 0 Fclear; set echo off; set console off; dc_expl(5,10,20,70," Let's print this window only "); DC_PRTSC(5,10,20,70); @ 10,20 say "Now, let's print the entire screen"; DC_PRTSC(); set echo on; set console on 193DC_PRTSC() FD 6-100 0 Fcondition='.t.'; clear; close all; use baseball; condition=DC_QUERY(condition); if empty(condition) goline end; locate for &condition; display; wait 194DC_QUERY() FD 6-101 0 Fclear; close all; set exclusive off; use baseball; repl player with player; ? DC_RECLOCK(); repl player with player; unlock; wait 195DC_RECLOCK() FD 6-103 0 Fclear; close all; DC_SEARCH('BASEBALL','ROSE'); DC_SEARCH('*','DCLIP','SEARCH.html'); type search.txt 196DC_SEARCH() FD 6-107 0 FDC_SETINIT() 197DC_SETINIT() FD 6-109 0 Fclear; set cursor off; ? DC_SETREAD('CURS'); set cursor on; ? DC_SETREAD('CURS'); set device to print; ? DC_SETREAD('DEVI'); set device to screen; ? DC_SETREAD('DEVI'); ? DC_SETREAD('DATE'); wait 198DC_SETREAD() FD 6-112 0 Fclear; dc_setsave('main'); set cursor off; set device to print; set date italian; ? dc_setread('curs'); ? dc_setread('devi'); ? dc_setread('date'); DC_SETREST('MAIN'); ? dc_setread('curs'); ? dc_setread('devi'); ? dc_setread('date'); wait 199DC_SETREST() FD 6-113 0 Fclear; DC_SETSAVE('MAIN'); set cursor off; set device to print; set date italian; ? dc_setread('curs'); ? dc_setread('devi'); ? dc_setread('date'); dc_setrest('main'); ? dc_setread('curs'); ? dc_setread('devi'); ? dc_setread('date'); wait 200DC_SETSAVE() FD 6-114 0 Fclear; / clear;?'hello world';a=1;DC_SETSTEP(.T.);do while a<10;@ a+3,10 say 'this is line '+str(a);a=a+1;enddo;DC_SETSTEP(.F.);? 'Goodbye world...' 201DC_SETSTEP() FD 6-115 0 Fclear; set cursor off; ? DC_SETT('CURS'); set cursor on; ? DC_SETT('CURS'); ? DC_SETT('PATH'); ? DC_SETT('DELI'); ? DC_SETT('EXAC'); wait 202DC_SETT() FD 6-116 0 Fclear; DC_SETWRIT('CURS',.T.); set cursor; DC_SETWRIT('DATE','FRENCH'); set date; wait 203DC_SETWRIT() FD 6-117 0 F? DC_TSTFILE('DEMO.PRG',.f.,.t.); wait; ? DC_TSTFILE('XXX.XX',.t.,.t.); wait; ? DC_TSTFILE('XXX.XX',.t.); wait 204DC_TSTFILE() FD 6-127 0 Fclear; close all; DC_UTIL(); wait; DC_UTIL('C'); wait; use baseball; DC_UTIL('D') 205DC_UTIL() FD 6-129 0 Farray=array(5); afill(array,'JUNK'); display array array; AADD(array,'MORE JUNK'); display array array; wait; AADD(array,{'SUB JUNK1','SUB JUNK2','SUB JUNK3'}); display array array[7]; wait 206AADD() FC 5- 1 0 Fnum1=100; num2=150; ?num1-num2; ?ABS(num1-num2); wait 207ABS() FC 5- 2 0 Fclear; close all; use baseball; array=array(fcount()); afields(array); field = ACHOICE(10,10,18,20,array); ? field; ? field(field); wait 208ACHOICE() FC 5- 3 0 Fclear; close all; use baseball; array=array(fcount()); afields(array); display array array; array2=ACLONE(array); display array array2; wait 209ACLONE() FC 5- 7 0 Fclear; close all; use baseball; array=array(fcount()); afields(array); array2=array(15); afill(array2,'junk'); ACOPY(array,array2,1,5,7); display array array2; wait 210ACOPY() FC 5- 8 0 Fclear; array=array(10); afill(array,'junk'); ADEL(array,1); display array array; wait 211ADEL() FC 5- 9 0 Fclear; array=array(4,4); ADIR('DCTUTOR*.*',array[1],array[2],array[3],array[4]); display array array[1]; display array array[2]; display array array[3]; display array array[4]; wait; rele array 212ADIR() FC 5- 10 0 Fclear; af=directory('DCTUTOR*.*'); cb = { | af | qout(padr(af[1],13),af[2],af[3],af[4]) }; AEVAL( af, cb ); wait 213AEVAL() FC 5- 12 0 Fclear; close all; use baseball; fields=array(4,fcount()); AFIELDS(fields[1],fields[2],fields[3],fields[4]); disp array fields[1]; wait; disp array fields[2]; wait 214AFIELDS() FC 5- 14 0 Fclear; close all; use baseball; BROWSE(5,10,20,70) 215BROWSE() FC 5- 33 0 Fclear; close all; use baseball; AF = ARRAY(2,FCOUNT()); afields(af[1],af[2]); display array af[1]; wait; display array af[2]; wait 216ARRAY() FC 5- 21 0 Fclear; BEGINPAINT(); @ 10,10 say 'This is an'; @ 11,10 say 'example of '; @ 12,10 say 'beginpaint()'; @ 13,10 say 'and endpaint()'; ENDPAINT(); wait 217BEGINPAINT() / ENDPAINT() FC 5-XX 0 Fclear; f = {}; aadd(f,{'name','c',25,0}); aadd(f,{'address','c',50,0}); aadd(f,{'phone','N',13,0}); DBCREATE( 'JUNK', f ); use junk; disp stru 218DBCREATE() FC 5- 43 0 Fclear; close all; use baseball; cb = { || qout(player,team,league) }; DBEVAL( cb ); wait; DBEVAL( cb, { || league='NL' } ); wait 219DBEVAL() FC 5- 49 0 Fclear; close all; use baseball; DBEDIT() 220DBEDIT() FC 5- 45 0 Fclear; close all; use baseball; array=array(10); afields(array); ASORT(array); display array array; wait 221ASORT() FC 5- 26 0 Fclear; ? CURDIR(); ? CURDIR('D:'); wait 222CURDIR() FC 5- 40 0 Fclear; cb1={ | a | a * 10 }; ? EVAL( cb1, 2 ); ? EVAL( cb1, 40 ); cb2 = { | a, b | a * b }; ? EVAL( cb2, 3, 2 ); ? EVAL( cb2, 10, 7 ); wait 223EVAL() FC 5- 76-CL 0 Fclear; myarray=array(2,5); AFILL(MYARRAY[1],'junk'); AFILL(MYARRAY[2],DATE()); display array myarray[1]; display array myarray[2]; wait 224AFILL() FC 5- 16 0 Fmyarray=array(10); afill(myarray,'junk'); AINS(MYARRAY,3); AINS(MYARRAY,7); display array myarray; wait 225AINS() FC 5- 17 0 Fclear; close all; sele 17; use baseball; sele 45; use sales; ? ALIAS(); ? ALIAS(45); ? ALIAS(17); wait 226ALIAS() FC 5- 18 0 Fclear; ? ALLTRIM(" this is a test "); wait 227ALLTRIM() FC 5- 19 0 Fclear; ? ASC('A'); ? ASC('a'); wait 228ASC() FC 5- 22 0 Fclear; close all; use baseball; fieldarray=array(fcount()); afields(fieldarray); fieldnum=ASCAN(fieldarray,'LEAGUE'); ? fieldnum; ? field(fieldnum); ? ASCAN(fieldarray,{|x|x='LEAGUE'}); wait 229ASCAN() FC 5- 23 0 Fclear; myarray=array(4); afill(myarray,'junk'); display array myarray; ASIZE(myarray,7); display array myarray; ASIZE(myarray,3); display array myarray; wait 230ASIZE() FC 5- 25 0 Fclear; string='THIS IS A TEST'; ? AT('IS',string); ? AT('TEST',string); wait 231AT() FC 5- 28 0 Fclear; ? BIN2I(chr(0)); ? BIN2I(chr(0)+chr(1)); ? BIN2I(chr(1)+chr(1)); ? BIN2I(chr(0)+chr(8)); ? BIN2I(chr(255)+chr(255)); wait 232BIN2I() FC 5- 29 0 Fclear; ? BIN2L(chr(0)); ? BIN2L(chr(0)+chr(1)); ? BIN2L(chr(0)+chr(0)+chr(1)); ? BIN2L(chr(1)+chr(0)+chr(1)); ? BIN2L(chr(0)+chr(0)+chr(0)+chr(1)); ? BIN2L(chr(255)+chr(255)+chr(255)+chr(255)); wait 233BIN2L() FC 5- 30 0 Fclear; ? BIN2W(chr(0)); ? BIN2W(chr(0)+chr(1)); ? BIN2W(chr(1)+chr(1)); ? BIN2W(chr(255)+chr(255)); wait 234BIN2W() FC 5- 31 0 Fclear; close all; use baseball; go top; ? BOF(); skip -1; ? BOF(); wait 235BOF() FC 5- 32 0 Fclear; ? CDOW(DATE()); ? CDOW(DATE()+1); wait 236CDOW() FC 5- 34 0 Fclear; ? CHR(97)+CHR(98)+CHR(99)+CHR(100)+CHR(101); ? CHR(176)+CHR(177)+CHR(178); wait; 237CHR() FC 5- 35 0 Fclear; ? CMONTH(DATE()); ? CMONTH(CTOD('12/31/90')); wait; 238CMONTH() FC 5- 36 0 Fclear; ? COL(); ?? COL(); wait 239COL() FC 5- 37 0 Fclear; datestring = "12/31/90"; ? datestring; ? valtype(datestring); datevalue = CTOD ( datestring ); ? datevalue; ? valtype(datevalue); wait 240CTOD() FC 5- 38 0 Fclear; ? DATE(); ? DATE()+1; wait 241DATE() FC 5- 41 0 Fclear; ? DAY(DATE()); ? DAY(DATE()+1); wait 242DAY() FC 5- 42 0 Fclear; close all; use baseball; ? DBF(); wait; 243DBF() FC 5- 51 0 Fclear; close all; use baseball; set filter to TEAM='NL'; ? DBFILTER(); wait; 244DBFILTER() FC 5- 52 0 Fclear; close all; use baseball; sele 0; use sales; set relation to YEAR INTO BASEBALL; ? DBRELATION(); wait 245DBRELATION() FC 5- 54 0 Fclear; close all; use baseball; sele 0; use sales; set relation to YEAR INTO BASEBALL; ? DBRSELECT(1); ? DBRELATION()+' into '+ALIAS(DBRSELECT(1)); wait 246DBRSELECT() FC 5- 56 0 Fclear; close all; use baseball; MYARRAY = DBSTRUCT(); aeval ( myarray, { |a| qout(padl(a[1],12),a[2],a[3],a[4]) }); wait 247DBSTRUCT() FC 5- 57 0 Fclear; close all; use baseball; delete; ? DELETED(); recall; ? DELETED(); wait 248DELETED() FC 5- 58 0 Fclear; close all; use baseball; index on DESCEND(team) to temp; list player,team,league; wait; use; erase temp.ntx 249DESCEND() FC 5- 59 0 F 250DEVICEPOS() FC 5- 60 0 Fclear; myarray=DIRECTORY('*.dbf'); aeval(myarray,{|a|qout(padl(a[1],13),a[2],a[3],a[4],a[5])}); wait 251DIRECTORY() FC 5- 61 0 Fclear; close all; erase junk.dbf; use baseball; ? DISKSPACE(); copy to junk; use; ? DISKSPACE(); wait 252DISKSPACE() FC 5- 63 0 F 253DOSERROR() FC 5- 64 0 Fclear; ? DOW(DATE()); ? DOW(DATE()+1); wait 254DOW() FC 5- 65 0 Fclear; datevalue=date(); ? datevalue; ? valtype(datevalue); datestring=DTOC(datevalue); ? datestring; ? valtype(datestring); wait 255DTOC() FC 5- 66 0 Fclear; ? DTOS(DATE()); ? DTOS(DATE()+365); wait 256DTOS() FC 5- 67 0 F? EMPTY('junk'); ? EMPTY(' '); ? EMPTY(123); ? EMPTY(0); ? EMPTY(DATE()); ? EMPTY(CTOD(' / / ')); ? EMPTY(.t.); ? EMPTY(.f.); ? EMPTY( { || 2*3 } ); ? EMPTY( { } ); wait 257EMPTY() FC 5- 68 0 Fclear; close all; use baseball; go bott; ? EOF(); skip; ? EOF(); wait 258EOF() FC 5- 70 0 Fclear; dcliperror=ERRORBLOCK(); ERRORBLOCK( { || BREAK(1) } ); * create an error; ? THIS IS A TEST; * we should be back at the dot prompt; * restore original error handler; ERRORBLOCK( dcliperror ); * create an error; ? THIS IS A TEST; wait 259ERRORBLOCK() FC 5- 72 0 FERRORLEVEL(6); ? ERRORLEVEL(); wait 260ERRORLEVEL() FC 5- 74 0 Fset decimals to 10; ? EXP(1); ? EXP(2); ? LOG(EXP(2)); wait 261EXP() FC 5- 77 0 Fclear; handle=fcreate('junk.html'); fwrite(handle,'line 1'+chr(13)+chr(10)); fwrite(handle,'line 2'+chr(13)+chr(10)); FCLOSE(handle); type junk.txt; wait 262FCLOSE() FC 5- 78 0 Fclear; close all; use baseball; ? FCOUNT(); wait 263FCOUNT() FC 5- 79 0 Fclear; crlf=CHR(13)+CHR(10); handle=FCREATE('junk.html'); fwrite(handle,'junk line 1'+crlf); fwrite(handle,'junk line 2'+crlf); fclose(handle); type junk.txt; dir junk.txt; handle=FCREATE('junk.html'); fclose(handle); dir junk.txt; wait 264FCREATE() FC 5- 80 0 Fclear; close all; use baseball; copy to junk; dir junk.dbf; ? FERASE('JUNK.DBF'); dir junk.dbf; ? FERASE('JUNK.DBF'); wait 265FERASE() FC 5- 82 0 F 266FERROR() FC 5- 83 0 Fclear; close all; use baseball; ? FIELD(1); ? FIELD(2); ? FIELD(3); ? FIELD(4); wait 267FIELD() FC 5- 85 0 Fset default to; ? FILE('BASEBALL.DBF'); ? FILE('XXXXX.XXX'); wait 268FILE() FC 5- 87 0 F? FKLABEL(1); ? FKLABEL(9); ? FKLABEL(10); ? FKLABEL(19); ? FKLABEL(20); ? FKLABEL(30); wait 269FKLABEL() FC 5- 88 0 F? FKMAX(); wait 270FKMAX() FC 5- 89 0 Fclear; close all; set exclusive off; use baseball; dele for recno()>5; ? FLOCK(); dele for recno()>5; recall all; unlock; set exclusive on; wait 271FLOCK() FC 5- 90 0 Fclear; close all; handle=FOPEN('DCTUTOR1.NTX'); fseek(handle,22); ? trim(freadstr(handle,256)); fclose(handle); wait 272FOPEN() FC 5- 93 0 Fclear; close all; use baseball index team; seek 'LAKERS'; ? FOUND(); seek 'DODGERS'; ? FOUND(); wait 273FOUND() FC 5- 94 0 Fclear; close all; handle=fopen('dctutor1.ntx'); buffer=SPACE(256); fseek(handle,22); FREAD(HANDLE,@BUFFER,256); ? buffer; fclose(handle); wait 274FREAD() FC 5- 96 0 Fclear; close all; handle=fopen('baseball.dbf'); fseek(handle,32,0); ? FREADSTR(handle,10); fseek(handle,64,0); ? FREADSTR(handle,10); fclose(handle); wait 275FREADSTR() FC 5- 98 0 Fclear; close all; use baseball; copy to junk; ? FRENAME('junk.dbf','newfile.dbf'); dir newfile.dbf; erase newfile.dbf; wait 276FRENAME() FC 5- 99 0 Fclear; close all; handle=fopen('dctutor1.ntx'); FSEEK(handle,22); ? freadstr(handle,256); fclose(handle); wait 277FSEEK() FC 5-100 0 Fclear; cr=CHR(13)+CHR(10); handle=fcreate('junk.txt'); FWRITE(handle,'junk line 1'+cr); FWRITE(handle,'junk line 2'+cr); FWRITE(handle,'junk line 3'+cr); fclose(handle); type junk.txt; wait 278FWRITE() FC 5-102 0 Fclear; ? GETENV('COMSPEC'); ? GETENV('DCLIP'); ? GETENV('CLIPPER'); wait 279GETENV() FC 5-104 0 Fclear; softtext='line 1'+chr(141)+chr(10)+'line 2'+chr(141)+chr(10); ? softtext; hardtext=HARDCR(softtext); ? hardtext; wait; ; 280HARDCR() FC 5-106 0 Fclear; close all; use baseball; ? 'Header size is: '+ str(HEADER()); ? 'File size is: '+str((recsize()*lastrec())+HEADER()+1); wait 281HEADER() FC 5-107 0 Fclear; a = 2; ? IIF(mod(a,2)=0,'a is even','a is odd'); wait 282IF() / IIF() FC 5-108 0 Fclear; ? INDEXEXT(); wait 283INDEXEXT() FC 5-109 0 Fclear; close all; use baseball index team,player; ? INDEXKEY(); ? INDEXKEY(1); ? INDEXKEY(2); set order to 2; ? INDEXKEY(); wait 284INDEXKEY() FC 5-110 0 Fclear; close all; use baseball index team,player; ? INDEXORD(); set order to 2; ? INDEXORD(); wait 285INDEXORD() FC 5-112 0 Fclear; keyboard ' a'; ? INKEY(); * now hit any key; ? INKEY(0) 286INKEY() FC 5-113 0 Fclear; ? INT(123.456); ? INT(3.78911055); wait 287INT() FC 5-115 0 Fclear; ? ISALPHA('A'); ? ISALPHA('z'); ? ISALPHA('#ABC'); ? ISALPHA('9'); wait 288ISALPHA() FC 5-116 0 Fclear; ? ISCOLOR(); wait 289ISCOLOR() / ISCOLOUR() FC 5-117 0 Fclear; ? ISDIGIT('8'); ? ISDIGIT('%'); ? ISDIGIT('A'); ? ISDIGIT('5ABC'); wait 290ISDIGIT() FC 5-118 0 Fclear; ? ISLOWER('a'); ? ISLOWER('A'); ? ISLOWER('9'); ? ISLOWER('z123'); wait 291ISLOWER() FC 5-119 0 Fclear; * take the printer off-line; wait; ? ISPRINTER(); * ready the printer; wait; ? ISPRINTER(); wait 292ISPRINTER() FC 5-120 0 Fclear; ? ISUPPER('A'); ? ISUPPER('a'); ? ISUPPER('9'); ? ISUPPER('*'); wait 293ISUPPER() FC 5-121 0 Fclear; a=I2BIN(4096); ? str(asc(substr(a,1,1))),str(asc(substr(a,2,1))); b=I2BIN(4097); ? str(asc(substr(b,1,1))),str(asc(substr(b,2,1))); wait 294I2BIN() FC 5-122 0 Fclear; keyboard chr(13)+chr(10); inkey(); ? LASTKEY(); wait 295LASTKEY() FC 5-123 0 Fclear; close all; use baseball; ? LASTREC(); sele 0; use sales; ? LASTREC(); wait 296LASTREC() FC 5-125 0 Fclear; ? LEFT('this is a test',7); ? LEFT('abcdef',2); wait; 297LEFT() FC 5-126 0 Fclear; ? LEN('this is a test'); ? LEN(""); myarray=array(4,10); ? LEN(myarray); ? LEN(myarray[1]); wait 298LEN() FC 5-127 0 Fclear; ? LOG(10); ? LOG(10 * 2); ? EXP(LOG(1)); ? LOG(2.718); wait 299LOG() FC 5-129 0 Fclear; ? LOWER('THIS IS A TEST'); ? LOWER('12345ABCDEF'); wait 300LOWER() FC 5-130 0 Fclear; test = ' this is a test '; ? test; ? len(test); ? LTRIM ( test ); ? len(LTRIM(test)); wait 301LTRIM() FC 5-131 0 Fclear; close all; use baseball; ? LUPDATE(); repl year with 81; ? LUPDATE(); wait 302LUPDATE() FC 5-132 0 Fclear; ? MAX ( DATE() , CTOD('12/31/90') ); ? MAX ( DATE() , DATE()+1 ); ? MAX ( 123 , 124 ); wait 303MAX() FC 5-134 0 Fclear; ? MAXCOL(); wait; setmode(25,40); ? MAXCOL(); wait; setmode(25,80); clear 304MAXCOL() FC 5-135 0 Fclear; @ 10,1 say 'the screen is '+str(MAXROW())+' rows long'; wait; setmode(50,80); @ 11,1 say 'the screen is '+str(MAXROW())+' rows long'; wait; setmode(25,80) 305MAXROW() FC 5-136 0 Fset echo off; set cons off; clear; memo = 'line 1'+chr(13)+chr(10)+'line 2'+chr(13)+chr(10); @ 9,9 to 21,51; memo = MEMOEDIT( memo, 10, 10, 20, 50 ); @ 24,0 say ''; set echo on; set cons on; ? memo; wait 306MEMOEDIT() FC 5-137 0 Fclear; cr = CHR(13)+CHR(10); text = 'line 1'+cr+'line 2'+cr+'line 3'+cr+'line 4'+cr; ? text; ? MEMOLINE ( text, 79, 3 ); wait 307MEMOLINE() FC 5-144 0 Fclear; readme = MEMOREAD ( 'READ.ME' ); ? readme; wait 308MEMOREAD() FC 5-146 0 Fclear; ? MEMORY(0); ? MEMORY(1); ? MEMORY(2); wait 309MEMORY() FC 5-147 0 Fclear; crlf = CHR(13)+CHR(10); text = 'line 1'+crlf+'line 2'+crlf+'line 3'+crlf+'line 4'+crlf; ? text; ? MEMOTRAN ( text, ' ', ' ' ); wait 310MEMOTRAN() FC 5-148 0 Fclear; crlf = CHR(13) + CHR(10); text = 'line 1'+crlf+'line 2'+crlf+'line 3'+crlf+'line 4'+crlf; ? text; MEMOWRIT ( 'JUNK.TXT', text ); type junk.txt; wait 311MEMOWRIT() FC 5-149 0 Fclear; ? MIN ( DATE(), DATE()+1 ); ? MIN ( DATE(), CTOD('12/31/90') ); ? MIN ( 123, 124 ); wait 312MIN() FC 5-150 0 Fclear; cr = CHR(13)+CHR(10); text = 'line 1'+cr+'line 2'+cr+'line 3'+cr+'line 4'+cr+'line 5'+cr; ? text; ? MLCOUNT ( text ); ? MLCOUNT ( text, 5 ); wait 313MLCOUNT() FC 5-151 0 Fclear; crlf = CHR(13)+CHR(10); text = 'line 1'+crlf+'line 2'+crlf+'line 3'+crlf+'line 4'+crlf; ? text; position3 = MLPOS ( text, 79, 3 ); ? position3; ? substr(text,position3); wait 314MLPOS() FC 5-153 0 Fclear; ? MOD ( 4, 3 ); ? MOD ( 4, 4 ); ? MOD ( 4, 2 ); ? MOD ( 7, 3 ); wait 315MOD() FC 5-154 0 Fclear; ? MONTH ( DATE() ); ? MONTH ( DATE() + 31 ); wait 316MONTH() FC 5-155 0 Fclear; close all; set exclusive off; use baseball; ? NETERR(); set exclusive on; wait 317NETERR() FC 5-156 0 Fclear; ? NETNAME(); wait 318NETNAME() FC 5-157 0 Fclear; keyboard chr(13)+chr(13); ? NEXTKEY(); wait 319NEXTKEY() FC 5-158 0 Fclear; ? OS(); wait 320OS() FC 5-159 0 Fclear; ? PADC ( 'this is a test', 30, '*' ); ? PADC ( DATE(), 25, '#' ); ? PADL ( 'abcd', 10, '-' ); ? PADR ( 'abcd', 10, '-' ); wait 321PADL() / PADC() / PADR() FC 5-160 0 Fclear; ? PCOL(); set printer to junk; set device to print; @ 10,10 say 'testing'; ? PCOL(); set device to screen; set printer to; wait 322PCOL() FC 5-162 0 Fclear; /proc testing; parameters a,b,c,d,e; ? PCOUNT(); return; testing ( 0, 0, 0 ); testing ( 0 ); wait 323PCOUNT() FC 5-164 0 Fclear; ? PROCLINE(0); ? PROCLINE(1); ? PROCLINE(2); wait 324PROCLINE() FC 5-165 0 Fclear; ? PROCNAME(0); ? PROCNAME(1); ? PROCNAME(2); wait 325PROCNAME() FC 5-166 0 Fclear; ? PROW(); set printer to junk; set device to print; @ 22,12 say 'testing'; ? PROW(); set device to screen; set printer to; wait 326PROW() FC 5-167 0 Fclear; QOUT ( ' testing', DATE(), 5*4 ); QQOUT ( 'more testing' ); close all; use baseball; dbeval ( { || QOUT(player,team,league) } ); wait 327QOUT() / QQOUT() FC 5-168 0 Fclear; ? RAT ( 'ab', 'abcabcabc' ); wait 328RAT() FC 5-169 0 Fclear; set cons off; READEXIT(.T.); test = space(5); @ 10,10 say 'READEXIT() is ON (.t.) - Press Dn Arrow ' GET test; READ; READEXIT(.f.); @ 10,10 say 'READEXIT() is OFF (.f.) - Press Dn Arrow ' GET test; READ; set cons on 329READEXIT() FC 5-170 0 Fclear; READINSERT(.t.); set cons off; test='this is a test '; @ 11,2 SAY 'READINSERT() is ON (.t.) - type some stuff' GET test; READ; test='this is a test '; READINSERT(.f.); @ 11,2 SAY 'READINSERT() is OFF (.t.) - type some stuff' GET test; READ; set cons on; 330READINSERT() FC 5-171 0 Fclear; set cons off; readkey=space(10); @ 10,10 say 'press any exit key' get readkey; read; set cons on; ? READKEY(); wait 331READKEY() FC 5-172 0 FGetList = {}; use baseball; set cons off; clear; @ 10,10 SAY 'Player name ' GET player; @ 11,10 SAY 'Team name ' GET team; READMODAL(GetList) ; savegets=GetList; wait ; GetList={}; READMODAL(GetList); READMODAL(SaveGets); set cons on 332READMODAL() FC 5-173 0 Fclear; close all; use baseball; ? RECCOUNT(); append blank; ? RECCOUNT(); delete; pack; ? RECCOUNT(); wait 333RECCOUNT() FC 5-176 0 Fclear; close all; use baseball; ? RECNO(); skip 5; ? RECNO(); skip 2; ? RECNO(); wait 334RECNO() FC 5-177 0 Fclear; close all; use baseball; ? RECSIZE(); use sales; ? RECSIZE(); wait 335RECSIZE() FC 5-179 0 Fclear; ? REPL ( 'abc', 5 ); ? REPL ( CHR(176), 25 ); characters=30; ? REPL ( '=', characters ); wait 336REPLICATE() / REPL() FC 5-180 0 Fclear; set cons off; screen=savescreen(); dc_expl(10,10,15,25,' My Box '); box=savescreen(9,8,16,26); set cons on; wait; RESTSCREEN(0,0,24,79,screen); RESTSCREEN(10,49,17,67,box); wait; RESTSCREEN(0,0,24,79,screen); RESTSCREEN(5,10,12,28,box); wait; set cons on 337RESTSCREEN() FC 5-181 0 Fclear; ? RIGHT ( 'ABCDEF' , 3 ); ? RIGHT ( 'This is a test', 4 ); ? RIGHT ( 'abcdefgh' , 1 ); wait 338RIGHT() FC 5-182 0 Fclear; close all; set exclusive off; use baseball; append blank; unlock; repl player with 'draft choice'; wait; RLOCK(); repl player with 'draft choice'; wait; unlock; set exclusive on 339RLOCK() FC 5-183 0 Fclear; ? ROUND ( 10.4, 0 ); ? ROUND ( 10.5, 0 ); ? ROUND ( 10.5, 1 ); ? ROUND ( 10.52, 1 ); ? ROUND ( 10.49999, 2 ); wait 340ROUND() FC 5-185 0 Fclear; ? ROW(); wait 341ROW() FC 5-186 0 Fclear; test = 'this is a test '; moretest = 'more testing'; ? test + moretest; ? RTRIM ( test ) + moretest; wait 342RTRIM() FC 5-187 0 Fclear; set cons off; screen=SAVESCREEN(); dc_expl(10,10,15,25,' My Box '); box=SAVESCREEN(9,8,16,26); set cons on; inkey(.2); restscreen(0,0,24,79,screen); restscreen(10,49,17,67,box); inkey(.2); restscreen(0,0,24,79,screen); restscreen(5,10,12,28,box); inkey(.2) 343SAVESCREEN() FC 5-188 0 Fclear; ? REPL ( " abcdefghijklmnopqrstuvwxyz ", 100 ); set cons off; @ 6,9 to 16,36; SCROLL( 7, 10, 15, 35, 1 ); inkey(.5); SCROLL (7, 10, 15, 35, 1 ); inkey(.5); SCROLL( 7, 10, 15, 35, -1 ); inkey(.5); SCROLL (7, 10, 15, 35, -1 ); inkey(.5) 344SCROLL() FC 5-189 0 Fclear; start_time=SECONDS(); DC_EXPLODE(10,10,20,20,'','','',.f.,150); INKEY(3); end_time=SECONDS(); ? 'Elapsed time = ' + STR ( end_time - start_time ) + ' seconds'; wait 345SECONDS() FC 5-190 0 Fclear; close all; sele 35; use baseball; sele 99; use sales; ? SELECT('BASEBALL'); ? SELECT('SALES'); wait 346SELECT() FC 5-191 0 F_set_date = 4; french='dd/mm/yy'; clear; * save date format; saveformat = SET ( _set_date ); ? saveformat; * set date format to FRENCH; SET ( _set_date, french ); ? SET ( _set_date ); * restore date format; SET ( _set_date, saveformat ); ? SET ( _set_date ); wait 347SET() FC 5-192 0 Fclear; ? SETCOLOR(); SETCOLOR ( 'W' ); ? 'color is white on black'; SETCOLOR ( 'W/R' ); ? 'color is white on red'; SETCOLOR ( 'W+/B' ); ? 'color is high-intensity white on blue'; wait 348SETCOLOR() FC 5-197 0 Fclear; ? SETCURSOR(); SETCURSOR ( 0 ); wait; SETCURSOR ( 2 ); wait; SETCURSOR ( 3 ); wait; SETCURSOR ( 4 ); wait; SETCURSOR ( 1 ); wait 349SETCURSOR() FC 5-200 0 Fclear; alt_t_key=276; SETKEY ( alt_t_key, { || QOUT(TIME()) } ); __wait('Press Alt-T for the time, any other key to continue ... '); SETKEY ( alt_t_key, {} ) 350SETKEY() FC 5-201 0 Fclear; QQOUT ( SETPOS ( 10, 10 ), 'writing to 10,10' ); QQOUT ( SETPOS ( 5, 50 ), 'writing to 5, 50' ); wait 351SETPOS() FC 5-203 0 F 352SETPRC() FC 5-204 0 Fset decimals to 10; clear; ? SQRT ( 2 ); ? SQRT ( 3 * 3 ); set decimals to 2; ? SQRT ( 100 ); wait 353SQRT() FC 5-208 0 Fclear; ? STR ( 2.3367 ); ? STR ( 2.3367, 3 ); ? STR ( 2.3367, 5, 3 ); wait 354STR() FC 5-209 0 Fclear; ? STRTRAN ( 'this is a test' , 's', 'S' ); ? STRTRAN ( 'abcdefghi', 'def', '' ); ? STRTRAN ( 'this is another test', ' ', '--'); wait 355STRTRAN() FC 5-211 0 Fclear; * insert; ? STUFF ( 'ABCDEF', 2, 0, 'xyz' ); * replace; ? STUFF ( 'ABCDEF', 2, 3, 'xyz' ); * delete; ? STUFF ( 'ABCDEF', 2, 2, '' ); * replace and insert; ? STUFF ( 'ABCDEF', 2, 1, 'xyz' ); * replace and delete; ? STUFF ( 'ABCDEF', 2, 4, 'xyz' ); wait 356STUFF() FC 5-212 0 Fclear; name = 'DONNAY Software Designs'; ? SUBSTR ( name, 1, 6 ); ? SUBSTR ( name, 8 ); ? SUBSTR ( name, 100 ); ? SUBSTR ( name, -7 ); ? SUBSTR ( name, -7, 3 ); wait 357SUBSTR() FC 5-214 0 Fclear; ? TIME(); wait 358TIME() FC 5-216 0 Fclear; TONE ( 100, 4 ); wait; TONE ( 1000, 10 ); wait; TONE ( 2000, 1 ); wait; QOUT(TONE(100,2),TONE(150,2),TONE(300,2)); wait 359TONE() FC 5-217 0 Fclear; ? TRANSFORM ( 123456, '$999,999.99' ); ? TRANSFORM ( DATE(), '99/99/99' ); ? TRANSFORM ( .T., 'Y' ); ? TRANSFORM ( 'abcdef', '@!' ); wait 360TRANSFORM() FC 5-219 0 Fclear; string = 'abcdef'; ? TYPE ( 'string' ); ? TYPE ( 'DATE()' ); myarray = array(4); ? TYPE ( 'myarray' ); ? TYPE ( 'myarray[1]' ); ? TYPE ( 'DCLIP()' ); wait 361TYPE() FC 5-221 0 Fclear; getvar=' change the contents of this field '; set cons off; @ 10,10 get getvar; read; set cons on; ? UPDATED(); getvar=' do not change the contents of this field, just press ENTER '; set cons off; @ 13,10 get getvar; read; set cons on; ? UPDATED(); wait 362UPDATED() FC 5-223 0 Fclear; test = 'this is a test'; ? test; ? UPPER ( test ); wait 363UPPER() FC 5-224 0 Fclear; close all; ? USED(); use baseball; ? USED(); wait 364USED() FC 5-225 0 Fclear; ? VAL ( '123' ); ? VAL ( '123.45' ); ? VAL ( 'abc' ); ? VAL ( '123abc' ); ? VAL ( '' ); ? VAL ( '123 456' ); wait 365VAL() FC 5-226 0 Fclear; ? VALTYPE ( 234.56 ); ? VALTYPE ( DATE() ); ? VALTYPE ( 9 > 8 ); myarray=array(4); ? VALTYPE ( myarray ); ? VALTYPE ( myarray[2] ); codeblock = { || qout(time()) }; ? VALTYPE ( codeblock ); ? VALTYPE ( NIL ); wait 366VALTYPE() FC 5-227 0 Fclear; ? VERSION(); wait 367VERSION() FC 5-228 0 F 368WORD() FC 5-229 0 Fclear; ? YEAR ( DATE() ); ? YEAR ( DATE() + 365 ); wait 369YEAR() FC 5-230 0 Cclear; MYARRAY1 = {}; disp array myarray1; MYARRAY2 = { 10, 22, "TEST", DATE() }; disp array myarray2; MYARRAY3 = { .t., TIME(), { 1, 2, 3 }, DATE()+1 }; disp array myarray3; wait; MYARRAY4 = { myarray1, myarray2, myarray3 }; disp array myarray4; wait 370 = { } C 5- 12-DC Cclear; MYCODEBLOCK = { | a,b | a * b }; ? eval ( mycodeblock, 6, 7 ); wait 371 = { | para | args } C 5- 12-DC