Hello,
For need a program, I need to run another program and retrieve its result in a variable. I do not know how. Anyone have an idea?
In advance, thank you
retrieve the results of a program in a variable
Re: retrieve the results of a program in a variable
Here's a simple example:
Hope this helps.
Code: Select all
PRG = RunProgram("cmd" , "/c echo %computername%" , "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
If PRG
While ProgramRunning(PRG)
If AvailableProgramOutput(PRG)
V$ = ReadProgramString(PRG)
Debug V$
EndIf
Wend
CloseProgram(PRG)
EndIf