Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.5.28 SetPath (set the path to the executable folder)

Purpose

Sets the path to the executable folder.

Syntax
SetPath ([DirPath])
Argument
DirPath

Specify the folder path to be set, using a character string or a variable that stores this value.

This value is optional. If you omit this value, the current folder (work folder) is assumed.

Description

The SetPath command sets the specified folder path as the current folder (work folder) path. The _BIN_ reserved variable is also converted to the specified folder path.

The command returns True on successful execution, or False if an error occurs. If the specified folder path does not exist, the command always returns False without changing the current folder (work folder) path.

Example
' Set the current folder for executable file "ABC.EXE" and
' execute the file.
' The current folder is OutDir folder specified by argument
' if OutDir folder contains a file.
' If OutDir folder is empty, the current folder is the folder
' of the script file being executed.
OutDir = %1
If IsEmptyDir ( OutDir ) = False Then
  SetPath ( OutDir )
  Exec ( "ABC.EXE" ,True )
  SetPath 
Else
  Exec ( _SCF_+"ABC.EXE" ,True )
End
JP1/Script version

Supported from JP1/Script 01-00.