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

 
Output of file : INIT.PRG contained in archive : OFFICE.ZIP
* INIT.PRG
* Module purpose: reset environment.
* Initialize printer and disk default drive.
CLEAR
SET TALK OFF
SET ECHO OFF
SET DEBUG OFF
SET STEP OFF
SET HEADINGS OFF
SET HELP OFF
SET MARGIN TO 0
SET MENUS OFF
SET SAFETY OFF
SET DELIMITER OFF
SET ESCAPE ON
* Optionally change to SET ESCAPE OFF.
SET INTENSITY ON
SET DEVICE TO SCREEN
SET PRINT OFF
SET CONSOLE ON
* Check for dBASE PLUS
* NOTE: May cause error with Developer's Release
IF TYPE("VERSION()") = "U"
SET STATUS OFF
ENDIF
CLOSE databases
CLOSE ALTERNATE
RELEASE ALL EXCEPT altdrive,maindrive,ad, ;
normprint,comprint,stdform,altform

* Determine drives, defaults, and paths.
PUBLIC altdrive,maindrive,ad
PUBLIC normprint,comprint,stdform,altform
STORE .f. TO workmem,workgo,workdc

* Determine if needed memory variables exist.
IF TYPE( 'maindrive' ) <> 'C'
? chr(7) + chr(7)
STORE .T. TO workmem
CLEAR
@ 2,5 SAY "Do You Have A Hard Disk Drive ? " ;
GET workdc
READ
STORE 'C:\' + SPACE(25) TO workdir

IF workdc
@ 11,5 SAY "Enter a Drive for Hard Disk. "
@ 12, 5 SAY "You May Enter an OPTIONAL sub-directory."
@ 13, 5 SAY "(Consult a DOS guide if necessary) "
@ 14, 5 SAY "(You must use backslashes: i.e.,\dbfiles\mailform\ )"
@ 16,25 GET workdir
READ
STORE TRIM(SUBSTR(workdir,1,3)) TO maindrive,altdrive
STORE TRIM(workdir) TO ad
SET PATH TO &ad,&maindrive
* ad is the Active Directory. All file operations
* (DIR, FILE) may need &ad preface.
ELSE
* Configure for two floppy system.
STORE "B:\" TO maindrive,ad
STORE "A:\" TO altdrive
* Assume 1) B is main drive; 2) no subdirectories.
SET PATH TO &maindrive,&altdrive
ENDIF workdc
SET DEFAULT TO &maindrive
ENDIF TYPE( 'maindrive')

* The file config.mem, if it exists, retains all variables.
* config.mem assumed to be on a root directory.
* Check for configuration memory file.
IF TYPE( "comprint" ) <> 'C'
IF FILE( "&maindrive.config.mem" )
RESTORE FROM &maindrive.config ADDITIVE
ELSE
IF FILE( "&altdrive.config.mem" )
RESTORE FROM &altdrive.config ADDITIVE
ENDIF
ENDIF
ENDIF

* All efforts to find print variables failed. Obtain from operator.
IF TYPE( "comprint" ) <> 'C'
STORE .t. TO workmem
CLEAR
@ 12,05 SAY "Warning! First Time Use or CONFIG.MEM file missing."
@ 14,05 SAY "Please Check for This File on Another Disk."
@ 15,05 SAY "Continued Operation Will Create New Memory Variables. "
@ 16,05 SAY "Continue Operation (T/F)? " GET workgo
READ
IF .NOT. workgo
CANCEL
ENDIF .NOT. workgo

* Initialize printer for:
* standard and alternate pitch, standard and alternate page length.
* Assign control sequences to key words in programs. Assume none are
* present if the compressed code is not found.
CLEAR
TEXT

PRINTER INSTALLATION MENU

Installs ASCII Control Sequences To Alter Printer Characteristics.
Puts Numbers In CHR Commands, Which Changes Printer To Compressed
Print Or Alters Form Feed To Print Checks. Consult Your Printer
Manual For Sequences. ENTER ONE NUMBER TO A LINE. EXAMPLE:

DBASE Needs To Send The Following Control Code Sequence To Change
Form Feed From 66 Lines to 42 Lines On An EPSON MX-80 Printer:

? CHR(27) + CHR(67) + CHR(42)

Enter at the 'ALT FORM ' prompt the codes on each line:

:27 :
EXAMPLE: :67 :
:42 :
: : [to EXIT]


INIT Will Do The Rest! You Need To Do This Only ONCE!

ENDTEXT
WAIT
CLEAR
DO printint WITH "normprint" , [Normal Print]
DO printint WITH "comprint" , [Compressed Print]
DO printint WITH "stdform" , [Standard Form Feed (66 lines)]
DO printint WITH "altform" , [Alternate Form Feed (42 lines)]
ENDIF TYPE( "comprint" ) <> 'C'
IF workmem
RELEASE ALL LIKE work*
* config is saved to Drive A for floppy system.
* The main drive for hard disk system.
SAVE TO &altdrive.config
ENDIF workmem

RETURN



  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OFFICE.ZIP
Filename : INIT.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/