DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Input of numerical data with numblock

WinXP Pro SP2 (english)
regional options: german
german standard keybord
Diadem 10.0

When typing numbers with the numblock in any input line or table of SUD-Dialog, Diadem detects the ","-Key as "." ( Input of "1,23" is interpreted as "1.23" ). Such a string can not convertetd to a float type. "1.23" is interpreted as 123 and that's wrong.

All other applications on the same computer, e.g. editors like "notepad" interprets the ","-Key as ",". What a nice feature of Diadem.

Martin Bohm



0 Kudos
Message 1 of 6
(3,581 Views)
Hello Martin,

You can use the DIAdem function VAL to convert a numerical string with dot syntax. This works fine.

Greetings
Walter
0 Kudos
Message 2 of 6
(3,577 Views)
I have to read data from a database with ODBC-commands, edit with a SUD-dialog (and numblock) and rewrite data to database. The construct for reading is simple: (type of data in database is double)

Editbox1.text = SQL_Result(1,1)

The construct for writing is:

Call SQL_ExecDirect("UPDATE table1 SET field1 ='"&CStr(val(Editbox1.Text))&"'")

The construct with 2 conversations of a string CStr( val(..) ) looks dirty and it runs dirty. The user see and have to use the "." as decimal separator. I think, the user expect the decimal sign of his regional settings.

0 Kudos
Message 3 of 6
(3,498 Views)

Hello Martin!

Just replace the VBScript 'CStr' with a DIAdem 'str' command.

The 'CStr' depends on the local settings the 'str' will always use a '.'.

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 6
(3,494 Views)
Hallo Matthias,

thanks for your advice. I know the type converting functions of VBS and Diadem. A microsoft access database expect for ODBC-setting of a field of type double an string with decimal sign ",". (Maybe a format accordingly whith the regional settings is required.) It means,  my first solution with CStr(val( )) ir right.  A construct with str() in a ODBC set command don't work correctly.

To NI:
Interpreting ',' of numblock as '.' has 3 disadvantages:
- User has to read and write numerical data in Diadem-format, not in his reginal settings.
- The "," key of numblock works different to the reginal keybord settings.
- A application programmer has to use VBS, but can't use the VBS type converting function anytime.

I am using Diadem since it's first release. Before I have worked with DIA/DAGO.  Diadem 1.0 was a consequent Windows-designed application.  But this "featue" is a cut with windows design.  It may be historical from DOS, that some input controls expect a "." , but it has to overcome.
0 Kudos
Message 5 of 6
(3,488 Views)
Sorry, it was a mistake of me. using the Str() -function instead of CStr()is the right solution.

Call SQL_ExecDirect("UPDATE table1 SET field1 ='"&Str(val(Editbox1.Text))&"'")

writes a numerical input to a database field of type double.
Thanks to Matthias.

Message 6 of 6
(3,483 Views)