E r g e b n i s / R e s u l t
Checks for the existence of a file
B e s c h r e i b u n g / D e s c r i p t i o n
The developer can pass a nickname:filename to this routine and the
routine checks for the existence of the file in the nickname specified.
This lets you prompt a user for a file name and then check to see if it
exists.
S y n t a x
Code:
value = call('EXISTS' , filename , scope) P a r a m e t e r
filename - is any filename. A nickname may precede the filename.
scope - A boolean value that determines where to look for the filename.
If the scope is FALSE, then only the nickname / volume is
searched for the file. If there is no nickname, then the
first searching order is used.
If the scope is TRUE, then the nickname is searched first and
then each of the searching orders.
R e t u r n s
An integer value.
-1 = Parameter error
0 = File does not exist
1 = File exists
B e i s p i e l / E x a m p l e
Code:
attach 'FILE'
put 'Please enter a file' , do newline
a = ''
get a
if call('EXISTS' , a , true) = 1
put 'The file exists'
end if
detach 'FILE' Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_DB