starting directory

Prev Next

Function Names

starting directory

Description

When B4P is started, it will look for "main.b4p" in the starting directory. The starting directory is stored in the file "B4P User Settings.json" located in the directory for application data.

If no parameter is provided: Retrieve the staring directory path. If directory path is provided: Change the starting directory.

Call as: procedure or function

Restrictions

Indirect parameter passing is disabled

Parameter count

0 - 1

Parameters

No.TypeDescription
Opt. 1
input
string new path and directory name

In order to avoid problems, use absolute directory paths.

Return value

TypeDescription
string Starting directory

Full path name of starting directory. It does not have a directory separator symbol at the end.

Exceptions

Specified starting directory does not exist or is not accessible

Examples

               saved starting directory[] = starting directory();
               echo(" Old starting directory: ", saved starting directory [] );
               starting directory( working directory () );
               echo(" New starting directory: ", starting directory () );
               starting directory( saved starting directory[] );
               echo(" Back to old starting directory: ", saved starting directory [] );

Output

 Old starting directory: C:\Users\zur-b\B4P
New starting directory: C:\Users\zur-b\OneDrive\Documents\Programme\Beyond4P\B4P_Docu_Maker
Back to old starting directory: C:\Users\zur-b\B4P
Try it yourself: Open LIB_Function_starting_directory.b4p in B4P_Examples.zip. Decompress before use.