prompt

Prev Next

Function Names

prompt

Description

This function changes the prompt to be displayed in interactive mode and memorizes it so it will be used whenever B4P is started. The prompt can be enriched with useful data such as current date and time, current working directory, etc. Advice: Use this function in interactive mode. Not recommended to specify it inmidst a B4P program.

Call as: procedure or function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
Opt. 1
input
string B4P expression

Specify a B4P expression (as a string, not code piece like in other functions) which will be saved and applied whenever interactive mode is invoked.
Providing a blank string ('') will restore factory settings, i.e. '>>'.

Return value

TypeDescription
string Currently defined prompt

The prompt as shown in interactive mode will be returned

Example using Interactive Mode

>> prompt( "working directory()+ ' >>'" )
C:\Users\Zur Bonsen Georg\Documents\Programme\Beyond4P\B4P_Docu_Maker >> echo (Hello)
Hello
C:\Users\Zur Bonsen Georg\Documents\Programme\Beyond4P\B4P_Docu_Maker >> prompt( "str(date time( now )) + '>'"  )
2020-10-01 20:15:29>
2020-10-01 20:15:31> prompt( "right last match( working directory(), "\") + ' >>'" )
B4P_Docu_Maker >> $ cd ..
B4P: Verify and resolve path '..' ...
     OK. Current directory changed to 'C:\Users\Zur Bonsen Georg\Documents\Programme\Beyond4P\'

Beyond4P >> $ cd *Maker
B4P: Verify and resolve path '*Maker' ...
     OK. Current directory changed to 'C:\Users\Zur Bonsen Georg\Documents\Programme\Beyond4P\B4P_Docu_Maker\'

B4P_Docu_Maker >> prompt ("")
>> =prompt()
>> ["string"]
>>