Result$ = ReadProgramString(Program [, Flags])
Reads a line from the output (stdout) of the given program. This function waits until there is data available to read from the program. To prevent this wait, AvailableProgramOutput() may be used first to check if there is something to read. This function also waits until a full line of output is available. If not line-based or raw output is to be read, ReadProgramData() may be used.


Program The program to use. It must have been started before with RunProgram() and the #PB_Program_Read flag.
Flags (optional) The string format to use when reading the output. The default format can be affected with the #PB_Program_Ascii, #PB_Program_Unicode and #PB_Program_UTF8 flags for RunProgram(). This can be one of the following values:
  #PB_Ascii  : Reads the output as ascii
  #PB_UTF8   : Reads the output as UTF8 (default)
  #PB_Unicode: Reads the output as unicode

Return value

A string created from program output.


However, the function remains blocked indefinitely if the program requests the intervention of the user. For example, return a yes / no choice to the program to continue.

See Also


Supported OS


<- ReadProgramError() - Process Index - RemoveEnvironmentVariable() ->