TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: CHARLES GODARD
from: LAWRENCE GORDON
date: 1997-01-24 09:23:00
subject: Get Current Directory

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.