Force variable evaluation
Posted: Wed Jan 24, 2007 1:51 am
I have looked through the help file and the forum and I just can't figure it out. How can I force evaluation of a variable so I can use the variable value in a listname declaration?This creates the list with the name temp$, not the value that was returned from the procedure.
Is there a way to make this work?
Also, I asked a question in my other thread that was a little off topic and it didn't get an answer. Is there any way to capture the errorlevel / exitcode from xcopy? I researched the Process library and even used the sample code but I just can't get it to capture anything out of xcopy. Not even the help text from using /?.
Here is the sample code with only the program changed to use xcopy instead:
Code: Select all
temp$ = SomeProcedureCallReturnValue()
NewList temp$()
Is there a way to make this work?
Also, I asked a question in my other thread that was a little off topic and it didn't get an answer. Is there any way to capture the errorlevel / exitcode from xcopy? I researched the Process library and even used the sample code but I just can't get it to capture anything out of xcopy. Not even the help text from using /?.
Here is the sample code with only the program changed to use xcopy instead:
Code: Select all
Compiler = RunProgram("c:\windows\system32\xcopy.exe", "/?", "", #PB_Program_Open|#PB_Program_Read)
Output$ = ""
If Compiler
While ProgramRunning(Compiler)
Output$ + ReadProgramString(Compiler) + Chr(13)
Wend
Output$ + Chr(13) + Chr(13)
Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
EndIf
MessageRequester("Output", Output$)