home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
homonlib.zip
/
HOMEPATH.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-04-13
|
982b
|
31 lines
DEFINT A-Z
DECLARE FUNCTION HomePath$ ()
'External procedures:
DECLARE FUNCTION TempName$ (p$)
FUNCTION HomePath$
'****************************************************************************
'Returns the name of the current DOS directory.
'****************************************************************************
tempfile$ = TempName$("") 'Make a temporary filename.
SHELL ("CD > " + tempfile$) 'Shell out and redirect the output of the
'DOS command "CD" to the temporary file.
fh = FREEFILE 'Get the next available file handle.
OPEN tempfile$ FOR INPUT AS #fh 'Open the temporary file.
LINE INPUT #fh, hp$ 'Read in the one and only line.
CLOSE #fh 'Close the file.
KILL tempfile$ 'Delete the temporary file.
HomePath$ = hp$ 'Return the name of the current directory.
END FUNCTION