Jump to content

Send cncBreak() command, variable from a text file?


Recommended Posts

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
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
×
×
  • Create New...