10-05-2012 09:36 AM
Greetings,
Under diadem 2010, we're having a little problem setting locale behavior in a dialog.
Just as is displayed in the test.sud file attached, we're trying to display a number in a text edit field in the dialog, but the dialog uses the system locale behavior (set as "es-es" in our computers), so it displays "0,5". The msgbox shows "0.5", though.
The code for the button is like this:
Sub Button1_EventClick(ByRef This) 'Created Event Handler
SetLocale("en-us")
dim a
a = 5/10
msgbox "result to display in editbox: "&a
EditBox1.Text = a
End Sub
But as it doesn't work, I suspect it isn't the right way to set it. So... any idea?
Thanks!
10-08-2012 11:26 AM
Hi tlahoz,
The simplest thing would be to use the DIAdem command "str(StringToFormat, FormatString)" to format the text field display the way you want it to appear. Is there a particular reason you want to rely on the locale setting to accomplish the display formatting?
Brad Turpin
DIAdem Product Support Engineer
Naitonal Instruments
10-11-2012 01:56 AM
Thank you for the info.
The only reason is we're using the dialog as some kind of middle point between input data and output data in our program. Output data must be iso compliant, so it must be saved with dots instead of colons as separator.
As we had it, when we recovered the data from the dialog as a string, it was copied on the output file with colons. We've solved it changing its treatment to numeric.