1000 ! * CD(*UFD*).BAC 1005 INTEGER : EXTEND 1010 ; '** Change UFD pointer **' 1020 ; ' Ver 1.00, 1985-11-29' 1030 ; ' Copyright 1985 Dataindustrier AB' 1040 ; 1050 ! * Written by Benny L|fgren 1060 ! ** ** ** ** ** ** ** ** ** ** ** 1070 ! * 1080 ! * Ver date / Ver nb / Sign / Note 1090 ! * 84-07-20 / X.00 / BL / Main 1091 ! * 85-11-29 / 1.00 / BL / Release 1100 ! * 1110 ! ** ** ** ** ** ** ** ** ** ** ** 1120 ! * 1130 ! EJECT 1140 ! ******************************** 1150 ! * 1160 ! * Main routine 1170 ! * 1180 A$=FNStartpar$ : IF A$='' GOTO 1200 1190 IF A$='-D' OR A$='-d' A$='' 1195 GOTO 1250 1200 INPUT "Directory: "A$ : IF LEN(A$) GOTO 1250 1210 ! 1220 INPUT "Do you want to disable UFD pointer (N)? "A$ 1230 IF CHR$(ASCII(A$) AND 223)<>"Y" GOTO 1320 ELSE A$='' 1240 ! 1250 ON ERROR GOTO 1260 : GOTO 1300 1260 IF ERRCODE=21 ; 'File not found!' : GOTO 1320 1270 ; 'Error:' ERRCODE 'occured while setting UFD pointer!' 1280 GOTO 1320 1290 ! 1300 CD A$ 1310 ! 1320 ; FNExit 1330 ! 1340 ! ********************************* 1350 ! * 1360 ! * Check if user entered from DOS or BASIC 1370 ! * 1380 DEF FNChkdos LOCAL I 1390 I=PEEK2(65302)-160 1400 WHILE I<160 : IF PEEK2(I)=-212 RETURN -1 1410 IF PEEK(I)<>13 I=I+1 : WEND 1420 RETURN 0 1430 FNEND 1440 ! 1450 ! ********************************** 1460 ! * 1470 ! * Get start parameter string (if any) 1480 ! * 1490 DEF FNStartpar$ LOCAL Cmdsp,I,Cmd$=160 1500 Cmdsp=PEEK2(65302)-160 1510 WHILE I<160 : I=I+1 : IF PEEK(Cmdsp+I-1)=44 GOTO 1540 1520 IF PEEK(Cmdsp+I-1)=13 RETURN '' ! No startpar string 1530 WEND : RETURN '' ! No startpar string 1540 IF PEEK(Cmdsp+I)=255 I=I+1 ! Skip DOS-entry flag 1550 WHILE I<160 : IF PEEK(Cmdsp+I)=13 GOTO 1580 1560 IF PEEK(Cmdsp+I)<32 OR PEEK(Cmdsp+I)>127 RETURN '' 1570 Cmd$=Cmd$+CHR$(PEEK(Cmdsp+I)) : I=I+1 : WEND 1580 RETURN Cmd$ 1590 FNEND 1600 ! 1610 ! ************************************* 1620 ! * 1630 ! * Exit to DOS or BASIC 1640 ! * 1650 DEF FNExit LOCAL A$=21,A 1660 IF FNChkdos=0 GOTO 1710 ELSE CLOSE ! We MUST close ALL files!!! 1670 A$='CMDINT SYS'+CHR$(14,255,205,27,96,216,195,3,193) 1680 A=VARPTR(A$) 1690 IF CALL(A+11,A) ; "Can't load CMDINT.SYS, press any key for RESET!"; 1700 GET A$ : IF CALL(0) REM Just a miracle would get through here... 1710 END ! End to get out of a function is ugly but... 1720 FNEND