home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
FILE_OK.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
54 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME FILE_OK .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
$INCLUDE "DAS-NB02.INC"
COLOR 7,0
CLS
? "┌─────────────────────────────────────────────────────────────────────────────
? "│ fLegalFile% ( FileSpec$ )
? "├─────────────────────────────────────────────────────────────────────────────
? "│ I found that some of the memory managers' error trapping was getting in the
? "│ way of PowerBASIC's error traps when opening files, etc. so this little job
? "│ checks FileSpec$ to see if the drive is ready, the path exists, and the file
? "│ name is not NULL.
? "│ It is used by fCreateFile% and fOpenFile%
? "└─────────────────────────────────────────────────────────────────────────────
?
'┌───────────────────────────
FileName$ = DIR$("*.*") '│ get a known file
FileSpec$ = "I:\PUREJUNK\" + FileName$ '│ add an illegal drive:\path
'│
IF fLegalFile%( FileName$ ) THEN '│ test the known file
PRINT FileName$; " IS OK!" '│
ELSE '│
PRINT FileName$; " CAN'T BE OPENED" '│ (this shouldn't happen!)
END IF '│
'│
PRINT '│
'│
IF fLegalFile%( FileSpec$ ) THEN '│ test the trash
PRINT FileSpec$; " IS OK!" '│ (this shouldn't happen!)
ELSE '│
PRINT FileSpec$; " CAN'T BE OPENED" '│
END IF '└───────────────────────────