home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug105.arc
/
CMD-PRG.LQR
/
CMD-PRG.LBR
/
MAKEFLIP.XXX
< prev
Wrap
Text File
|
1979-12-31
|
4KB
|
158 lines
*
* Another dBASE II goody from:
*
* Head Quarters
*
* Gene Head
* 2860 NW Skyline Drive
* Corvallis, Oregon 97330
* (503) 758-0279
*
* For non-commercial use only. If you use this utility
* to help you develop any software that earns you money
* (even in your own business) send me $5.00.
* It's a fair price to pay and worth a clear conscience.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
*
* Program name --> MAKEFLIP.XXX
*
* (DO NOT change the name of this command file)
* (Execute it as .DO MAKEFLIP.XXX or it may not work)
*
* * * * This program generates the command file FLIP.IT * * *
*
* You only need to run this program ONCE to create FLIP.IT.
* After you create FLIP.IT put a copy on your dBASE II disk.
* Then when you wish to change default command file extension
* type .DO FLIP.IT
*
* Example:
*
* To run CP/M command files defaulted to .CMD under MS-DOS simply
* type .DO FLIP.IT. To change back to the .PRG default, type the
* same thing again, .DO FLIP.IT.
*
* Likewise, to run MS-DOS command files defaulted to .PRG under
* CP/M, type .DO FLIP.IT. To change back to .CMD default, again
* type .DO FLIP.IT.
*
*
SET TALK OFF
* This range works well for dBASE II versions 2.4,
* 2.41 and Z-80 2.41. For other versions you may have to experiment.
STORE '12300' TO LOW
STORE '12500' TO HIGH
* First get the range of program RAM to search
* for the default extension
STORE 'Y' TO CHOICE
DO WHILE CHOICE = 'Y'
STORE T TO RANGE
ERASE
DO WHILE RANGE
@ 12,10 SAY 'Enter START of search area. Suggest --> ';
GET LOW PICTURE '99999'
@ 14,10 SAY ' Enter END of search area. Suggest --> ';
GET HIGH PICTURE '99999'
READ
STORE VAL(LOW) TO MLOW
STORE VAL(HIGH) TO MHIGH
IF MLOW >= MHIGH .OR. MHIGH > 65000 .OR. MLOW < 100
@ 20,10 SAY 'SEARCH AREA OUT OF RANGE. TRY AGAIN . . .'
ELSE
STORE F TO RANGE
ENDIF MLOW >= MHIGH .OR. MHIGH > 65000 .OR. MLOW < 100
ENDDO WHILE RANGE
ERASE
* This is not the most accurate testing but the chances are
* very high that it will only find what we are looking for.
@ 12,10 SAY 'SEARCHING'
STORE F TO FOUND
DO WHILE (.NOT. FOUND) .AND. MLOW < MHIGH
IF PEEK(MLOW) <> 67 .AND. PEEK(MLOW) <> 80
STORE MLOW+1 TO MLOW
LOOP
ELSE
IF PEEK(MLOW+1) <> 77 .AND. PEEK(MLOW) <> 82
STORE MLOW+1 TO MLOW
LOOP
ELSE
IF PEEK(MLOW+2) <> 68 .AND. PEEK(MLOW) <> 71
STORE MLOW+1 TO MLOW
LOOP
ELSE
STORE T TO FOUND
LOOP
ENDIF PEEK(MLOW+2) <> 68 .AND. PEEK(MLOW) <> 71
ENDIF PEEK(MLOW+1) <> 77 .AND. PEEK(MLOW) <> 82
ENDIF PEEK(MLOW) <> 67 .AND. PEEK(MLOW) <> 80
ENDDO WHILE (.NOT. FOUND) .AND. MLOW < MHIGH
* If we found our patch area then create a command file called FLIP.IT
IF FOUND
@ 12,10 SAY 'CREATING COMMAND FILE --> FLIP.IT '
STORE STR(MLOW,5) TO PATCH
SET ALTERNATE TO FLIP.IT
SET ALTERNATE ON
SET CONSOLE OFF
? [* FLIP.IT]
? [*]
? [* FLIP.IT WILL FLIP DEFAULT COMMAND FILE EXTENSION .CMD <--> .PRG]
? [*]
? [* FLIP.IT IS DESIGNED FOR THOSE WHO DEVELOP PROGRAMS USING CP/M]
? [* dBASE II TO RUN UNDER MS-DOS dBASE II AND GET TIRED CHANGING]
? [* THE COMMAND FILE EXTENSIONS FROM .CMD TO .PRG AND VICE-VERSA!]
? [*]
? [* FLIP.IT CAUSES YOUR CP/M dBASE II TO ACCEPT .PRG AS THE DEFAULT]
? [* COMMAND FILE EXTENSION. IT CAN ALSO LET YOUR MS-DOS dBASE II]
? [* ACCEPT .CMD AS THE DEFAULT COMMAND FILE EXTENSION.]
? [*]
? [* IN EITHER CASE JUST TYPE .DO FLIP.IT]
? [*]
?
? [IF PEEK(]+PATCH+[) = 67]
? [ POKE ]+PATCH+[, 80, 82, 71]
? [ ? 'DEFAULT COMMAND EXTENSION --> .PRG']
? [ELSE]
? [ IF PEEK(]+PATCH+[) = 80]
? [ POKE ]+PATCH+[, 67, 77, 68]
? [ ? 'DEFAULT COMMAND EXTENSION --> .CMD']
? [ ELSE]
? [ ? 'ERROR CHANGING DEFAULT EXTENSION']
? [ ENDIF]
? [ENDIF]
?
SET ALTERNATE OFF
SET ALTERNATE TO
SET CONSOLE ON
STORE 'N' TO CHOICE
ELSE
@ 12,10 SAY 'CAN NOT LOCATE PATCH AREA WITHIN THE SPECIFIED RANGE.'
@ 14,10 SAY 'TRY AGAIN? (Y/N) ' GET CHOICE
READ
ENDIF FOUND
ENDDO while CHOICE = 'Y'
@ 12, 10