Skip to main content
KenFarley
21-Topaz II
March 30, 2023
Question

Warning : Careful when copying relations from e-mails

  • March 30, 2023
  • 2 replies
  • 1547 views

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,

2 replies

Dale_Rosema
23-Emerald III
July 25, 2023

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.

KenFarley
KenFarley21-Topaz IIAuthor
21-Topaz II
July 26, 2023

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.

Patriot_1776
22-Sapphire II
July 25, 2023

'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.