Amos Professional Manual  Contents  Index

Disc Access


The effect of the PARENT command is to load the current directory with the parent of the present folder you are using. By using this command repeatedly, you are able to get back to the original root directory simply and quickly. For example:

X> Dir$="AMOSPro_Examples:Objects/"
   Dir
   Parent
   Dir

ASSIGN
instruction: assign a name to a file or device
Assign "Name:" To "New_Pathname"
Assign "Name:" To "Device"

In the original AMOS system, you were obliged to go back to AmigaDOS every time that particular directories needed changing, for example, when changing the font directories. The ASSIGN command has been provided to solve this problem, and is fully explained in Chapter 11.1.

Checking for the existence of a file
It is possible to keep a tidy mind and a tidy desk, and maintain up to date records on discs. On the other hand, you may be normal. AMOS Professional provides three, ways to check for elusive files.

EXIST
function: check if specified file exists
value=Exist("filename")

EXIST looks through the current directory of filenames and checks it against the filename in your given string. If the names match, then the file does exist and a value of -1 (true) will be reported, otherwise 0 (false) will be returned.

As well as checking for individual filenames, even if an idiotic name is given, EXIST will search for discs and devices as well. For example:

E> Print Exist("An idiotic name")
   Print Exist("DEMO:") : Rem Is a disc named DEMO available
   Print Exist("Df1:") : Rem Is the second floppy drive connected

It is advisable to test for empty strings ("") separately, like this:

E> F$=Fsel$("*.IFF"," ","Load an IFF file")
   If F$="" Then Edit : Rem return to editor if no file chosen
   If Exist(F$) Then Load Iff F$,0
Back    Next
10.02.06