[M1...] Posted January 31 Share Posted January 31 (edited) 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 January 31 wrong spelling Link to comment Share on other sites More sharing options...
[Mi...] Posted January 31 Share Posted January 31 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 More sharing options...
[M1...] Posted January 31 Author Share Posted January 31 Thank you. Will try 🙂 Link to comment Share on other sites More sharing options...
[M1...] Posted February 3 Author Share Posted February 3 Michael, I tried both variants and your first suggestion was great. Thanks 👍 Link to comment Share on other sites More sharing options...
[Je...] Posted February 10 Share Posted February 10 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 More sharing options...
[M1...] Posted February 21 Author Share Posted February 21 Thanks Jeffrey 🙂 Link to comment Share on other sites More sharing options...
[Ri...] Posted February 21 Share Posted February 21 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 More sharing options...
[Mi...] Posted February 24 Share Posted February 24 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 More sharing options...
[Je...] Posted March 5 Share Posted March 5 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 More sharing options...
[Ri...] Posted March 7 Share Posted March 7 True story. 😂 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