Jump to content
Private Messaging is activated - check "How to" on how to disable it ×

Text input


---
 Share

Recommended Posts

Hello.

A simple PCM question perhaps:

I´m trying to create a dialogue where the operator needs to input a value to put in the protocol header. It is not allowed to be empty.

I tried something like this:

 

list=inquireText("Type a value")
setRecordHead("u_k0009_text",list)
if list
message("Value is empty, try again")
endif

Edited
wrong spelling
Link to comment
Share on other sites

Play with this. Similar task - different header value. Also has a loop and cancel if they try to leave it blank 3 times.

It's a more complicated, but it clears the value at the start, and traps the operator to force them to fill it out or the program can't run. Can't trust people lol

//Asks for employee numbers and puts it in the header data. Requested by QA Supervisor, only for QA CMMs
setRecordHead("vda_signature","")
loopCount = 0
repeat 
	setRecordHead("vda_signature",inquireNumber("Please Input your Employee ID to continue"))
	loopCount = loopCount +1
until  ((getRecordHead("vda_signature") <> "0") and (len(getRecordHead("vda_signature")) > 2)) or (loopCount == 3)

if (loopCount >= 3) and ((len(getRecordHead("vda_signature")) < 3)) then
	message("You must enter your employee number to continue, program will stop")
	cncBreak()
endif

Instead of (len(getRecordHead("vda_signature")) > 2) you could have getRecordHead("vda_signature") <> "" which means "Does not equal blank" since the first line sets it to blank....

Link to comment
Share on other sites

if getRecordHead("u_OperatorNumber") == "" then
	repeat
	operator = ""
	operator = inquireText("Operator Number")
	setRecordHead("u_OperatorNumber",operator)
	until (operator) <> ""
	endif
//----------------------SHIFT--------------------------
if getRecordHead("u_Fixture") == ""
	repeat
	shift= ""
	shift = inquireList("CNC Fixture ID","1","2","3")
	setRecordHead("u_Fixture",shift)
	until text(shift) <> ""
	endif

 

Link to comment
Share on other sites

  • 2 weeks later...

I think I have tried both Jeffs and Micheals methods in the past from one of my posts.

Then the operators just started putting in dashes and or dots. 😑

Link to comment
Share on other sites

To prevent people being people you'd have to do selections from lists where you can, or use other languages to take advantage of regular expressions or check input vs a database...

A lot more involved, the need easily prevented by a Supervisor going out and questioning unacceptable inputs.

Link to comment
Share on other sites

  • 2 weeks later...
---

 

Please sign in to view this quote.

inquireList prevents that. 

With inquireText() - Thats not really a program problem.  Thats a training problem.  Good luck with that. 😂

Link to comment
Share on other sites

 Share

×
×
  • Create New...