Filesystem-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands >

Filesystem-Commands

CHD. - Change current Directory and Drive

Previous Top Next


MiniRobotLanguage (MRL)

 

CHD. Command

Change current Directory and Drive

 

 

Intention

 

Change the "current directory". This command is somehow like CHDIR in old DOS times, but it will also change the current Drive. Usage is simple:

 

' Please use folders that are valid on your system

CHD.F:\00_S-Files\00_Desktop

DBP.?curdir\

CHD.?ws\

DBP.?curdir\

ENR.

 

Will result in something like this.

 

graphic

 

As you can see, we can switch the drive and the current directory in one strike.

If you only want to switch the current drive you can do it like that:

 

CHD.|C

 

The second parameter can be as long as it is, only the first letter on the left side will be taken, it should be a valid drive letter. For example:

 

VAR.$$FIL=F:\00_S-Files\00_Desktop

CHD.|$$FIL

 

is completely valid.

 

Note: CHD. will execute the command internally and then place the current directory on TOS. If CHD. will run into an error, you will find the unchanged current directory on the TOS.

 

 

Syntax

 

CHD.[P1][|P2]

 

 

Parameter Explanation

 

P1 - (optional) File-path to be set as current directory.

 

P2 - (optional) valid drive-Letter to change the current drive

 

 

 

 

Example

 

'********************************************

' Demo for CHD.

'********************************************

CHD.F:\00_S-Files\00_Desktop

DBP.?curdir\

CHD.?ws\

DBP.?curdir\

ENR.

END.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    ATF - Append-to-File

    CFF. - Copy-From-File

    CTF - Copy-To-File

    CTI. - Copy-To-Inifile

    CFI. - Copy-From_IniFile

    COP. - Copy File

    FEL - For-Each-Line

    GLC. - Get-Line-Count

    IEF. / NEF. - If - exist - File

    SHF. - Shell-File-Operation

    WFF. - Wait-For-File