On 23 Jan 97, Charles Godard wrote to Matt Roberts:
CG> MR>Hi. I'm working on a file-moving utility, and I want to get the
CG> current >directory (in case of a command like MOVEFILE A:.). I can
CG> already get >the current drive.
CG> >Directory. Problem is, I can never figure out how to set up DS:SI.
CG> MR>I think I have everything else set up all right (DX=0 for instance
CG> :).
> Any help showing a slow learner how to set up the string segment would
CG> >be greatly appreciated, however.
CG> Hi Matt, Try this
CG> DEFINT A-Z
CG> FUNCTION GetCurrentDirectory$ (Drive$)
CG> 'Drive$ = "c"
CG> '*need to check if there is a disk in the drive before calling
CG> 'function on a floppy
Why go through all that? PowerBASIC has a built-in function, CURDIR$, that
returns the current directory:
A$ = CURDIR$
PRINT A$
CURDRIVE$ = LEFT$(A$,1)
PRINT CURDRIVE$
--- PPoint 2.03
---------------
* Origin: Toast House Remote (1:100/560.1)
|