[Ri...] Posted January 12 Share Posted January 12 I have a text file named Canc-Cont.txt (Cancel-Continue). It will have a single line with a numeric value, "0" or "1". (0 = Cancel, 1 = Continue). I have PCM in my Pre-Settings window, how can I read the text file to obtain the numeric value in a variable? The contents of the text file is created from an "Exe" file. If the user "Cancels" the Exe file, send cncBreak() command. The "Cancel" command from the Exe file writes the Canc-Cont.txt file ("0"). Alternately, if the user continues the Canc-Cont.txt file will contain "1". //Declare variable "CanCon"? //Some text file reading code here if CanCon==0 cncBreak() endif Link to comment Share on other sites More sharing options...
[No...] Posted January 12 Share Posted January 12 Try this: my_list=readListFile("Canc-Cont.txt") CanCon=val(getParameterNamed(my_list,1)) if CanCon == 0 then cncBreak() endif Link to comment Share on other sites More sharing options...
[Ri...] Posted January 12 Author Share Posted January 12 Thank you, I was getting close with the "readListFile". //paramters exe file cancel, Start. 01.12.24 CanCon=1 //Read Canc-Cont.txt value my_list=readListFile("Canc-Cont.txt") //Extract value from file CanCon=val(getParameterNamed(my_list,1)) if CanCon==0 cncBreak() endif Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in