
*********************************************************************** 
* Program Name.....: TESTENT.CMD 
* Purpose..........: Data Entry For TEST 
* Author...........: Your Name 
* Copyright Notice.: Copyright (C) 1985, Your Name, All rights reserved 
* Date.............: 00/00/00 
* dBASE II version.: 2.4x 
* CMD file version : 1.0 
* Memory Variables.: "M"+Field names + control variables +...? 
* Comments/Notes...:                                            
*                  :                                            
*********************************************************************** 
* ---- ENVIRONMENT SECTION: 

* Reset dBASE II with no active data bases and no memory variables 
CLEAR 
SET STEP OFF ".......... Obviously." 
SET PRINT OFF "......... Obviously." 
SET ECHO OFF ".......... Obviously (unless you want to see commands)" 
SET TALK OFF ".......... Obviously (unless you want to see calculations)" 
SET ALTERNATE OFF "..... Obviously." 
SET ALTERNATE TO 
SET BELL OFF ".......... Obviously.  The Bell implementation is useless" 
SET CARRY OFF "......... This seems like a good default state" 
SET COLON ON ".......... Important.  Not every screen has intensity" 
SET CONFIRM OFF "....... Optional. You may want to default to ON." 
SET CONSOLE ON "........ Obviously." 
SET DEBUG OFF "......... Obviously." 
*                        included in a command with a scope (v. 2.4 only) 
SET EJECT OFF "......... This eliminates Ejects before printout and" 
*                        requires an EJECT at the completion of a printout 
SET ESCAPE OFF "........ Optional.  You may want to run with ESCAPE ON" 
SET EXACT OFF "......... Optional (though usual default is OFF)" 
SET FORMAT TO SCREEN ".. Obviously." 
SET INTENSITY OFF "..... Different screens have different ways of" 
*                        presenting intensity.  It is good to start with 
*                        it off and control it. 
SET LINKAGE OFF "....... Obviously." 
SET RAW ON "............ Optional (though this is a good default position" 
*                        to prevent problems with semi-colons) 
SET SCREEN ON "......... Obviously." 
ERASE "................. Clear the screen" 

* Put 79 blanks in a global memory variable 
STORE $(STR(0,80),1,79) TO gmbl 

USE TEST 
STOR "_____________________________________________________________" TO MBL80 
STOR $(MBL80,1, 30) TO MNAME 
STOR $("12123 FOURTH ST"+MBL80,1, 30) TO MADDRESS 
STOR $(MBL80,1, 30) TO MADDRESS2 
* ----- SCREEN FORMAT INITIALIZATION: 

ERASE 
SET INTE ON 
@  3,  1 SAY "NAME OF PERSON.:" 
@  4,  1 SAY "FIRST ADDRESS..:" 
@  5,  1 SAY "CITY/STATE/ZIP.:" 
SET INTE OFF 

GO BOTT 
STOR #+1 TO MRECNO 
STOR " " TO MOK 
DO WHILE T 
  @ 23,68 SAY "REC NO:"+STR(MRECNO,4) 
@ 1,1 say "                                      TEST" 
@ 2,1 say "===============================================================================" 
@ 22,1 say "===============================================================================" 
* ----- DATA INPUT SECTION: 

SET INTE ON 
  @  3, 17 GET MNAME PICT "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 
  @  4, 17 GET MADDRESS PICT "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 
  @  5, 17 GET MADDRESS2 
  READ  
SET INTE OFF 
  @ 23,0 SAY $(STR(0,80),1,79) 
* ----- DATA VALIDATION SECTION: 

  IF  MNAME # " " 
  IF MADDRESS = " " 
    @ 23,10 SAY CHR(7) 
    @ 23,10 SAY "FIRST ADDRESS IS A REQUIRED ENTRY, PLEASE RE-ENTER" 
    CLEAR GETS 
    LOOP 
  ENDIF 
ENDIF 
  SET INTE ON 
  @ 23,50 SAY "ALL OK? (*=QUIT)" GET MOK PICT "!" 
  READ  
  SET INTE OFF 
* ----- END PROCESSING SECTION: 

  IF MOK="*" 
    CLEA 
    SET TALK ON 
    RETURN 
  ENDIF 
  IF MOK#"Y" 
    @ 23,0 SAY $(STR(0,80),1,79) 
    LOOP 
  ENDIF 
  CLEAR GETS 
    @ 23,0 SAY $(STR(0,80),1,79) 
  APPE BLANK 
  STOR mrecno+1 TO mrecno 
* ----- DATA BASE UPDATE SECTION: 
  IF MNAME#"_" 
    REPL NAME WITH $(MNAME,1,@("_",MNAME)-1) 
  ELSE 
    REPL NAME WITH MNAME 
  ENDIF 
  IF MADDRESS#"_" 
    REPL ADDRESS WITH $(MADDRESS,1,@("_",MADDRESS)-1) 
  ELSE 
    REPL ADDRESS WITH MADDRESS 
  ENDIF 
  IF MADDRESS2#"_" 
    REPL ADDRESS2 WITH $(MADDRESS2,1,@("_",MADDRESS2)-1) 
  ELSE 
    REPL ADDRESS2 WITH MADDRESS2 
  ENDIF 
* -----  MEMORY VARIABLE UPDATE SECTION: 

  STOR $(MBL80,1, 30) TO MADDRESS 
  STOR $("12123 FOURTH ST"+MBL80,1, 30) TO MADDRESS 
  STOR $(MBL80,1, 30) TO MADDRESS2 
ENDDO GH)+'"'
ELSE
? '  IF M'+TRIM(FIELD:NAME)+' > '+TRIM(HIGH)
ENDIF
? '    @ 23,10 SAY "'+TRIM(ALIAS)+' CANNOT BE ABOVE '+TRIM(