Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Just had a perplexing experience where I sent some Creo relations code to a colleague, something simple, but it triggered a bunch of inexplicable error messages. The code was this:
txtResult = “VALUE IS “
IF numFloating < 1.0
txtResult = txtResult + “0.”
ELSE
txtResult = txtResult + ITOS ( floor ( numFloating ) ) + “.”
ENDIF
txtResult = txtResult + EXTRACT ( ITOS ( 1000 * ( 1 + numFloating – floor ( numFloating ) ) ), 2, 3 )
I couldn't figure out what in the world was going on. It's the kind of code I use all the time.
Turns out that when I e-mailed the text, Outlook, in it's annoying fashion, converted the quotes around the strings in the code to the two different quotes one would use if this text were being published in a book. If you look closely at the text, it is easy to see once you know it is there. What should have been
"0."
has been converted to
“0.”
which causes errors.
Just a warning for anyone who is using relations,
Are the open and closed quotes the ones needed for the relation to work correctly?
I noticed in the first line you have (2) open quotes and (0) closed quotes.
The problem I was having was because Outlook was "fixing" my text by switching the actual quotes I had, the <shift>-<Key next to Enter> to the shown open and close quotes, which, to be honest, I don't know how to type on a keyboard. That's why I said "which causes errors" after the converted text.
'Sup Ken!
Yeah, I'm not the greatest relation programmer for sure, but I've seen that as well. Probably best to make anything like that a plain text file (Notepad), and add the file as an attachment in Outlook, that way it's not compromised.