Changing the display style of a string control doesn't affect the data at
all, it just changes the way the control displays the string. The "Show
Codes" display style does just that, it SHOWS the codes in the display. It
does NOT change the contents of the string. You should just do a search for
new line characters and replace them with spaces, then do the save.
Kelly Bersch
Anadigm, Inc
www.Anadigm.com
"Greg Cole" wrote
Hi All,
I'm having a problem with writing the contents of a string control to
a file.
What I have is a setup screen with 2 multi-line string controls (among
other things) that I want to write to an ascii file on exit. I'm
trying to force any multiline contents of those two boxes to a single
line in the file. To do this I
created a property node for the string
control, changed the display style to 'show '\' codes' then write the
string. This works, with 1 caveat. While the user is in the setup I
want to display the strings without the codes, so I don't change the
display property until 'OK to exit' is clicked. When I add this
feature the strings are never output with the '\' codes.
Basically I have a state machine. On init of this vi I set defaults
for the controls and set the two string controls to normal display.
On the exit state I change the display to '\' codes then write the
contents to file. If I don't include the show normal property on the
init, the codes are written successfully, but they are also displayed
on the screen. If I include the show normal code in the init state,
the codes are not written to file.
Am I missing a refresh property or an updatedata-like function to
assure the string control is correcting its contents to the proper
format before I write it to file?
Any help ap
preciated.
Greg Cole
gcc9@cdc.gov