Re: scan from string / minus
This is the correct answer. %f interprets only numbers and either , or . depending on what your system uses as a decimal seperator. If you want both numbers, you need to use a format specifier of %f-%f which tells the function to get two numbers seperated by a -. This will return two values representing the numbers either side of the -. Alternatively, if the - is supposed to be a decimal point (The number should be 20.20) you can specify that the - should be used as a decimal seperator by using the format command %-;%f. Hope this helps. Shane.
Re: SCAN FROM STRING
I've solved my problem with %.;%f . Thanks to all the people for your help. IMMA
Re: SCAN FROM STRING
Hi IMMA, As far as I know, %f should do the trick. However, you need to take into account the setting for the local decimal point. If your machine is set to use comma , as decimal point, the scan from string will stop at 3 because it doesn't interpret the dot . as part of a number. There is an option in LabVIEW to use the local decimal point or not (At least in LV 6.1, I can't remember if it's in LV 5). This might help. Otherwise (as long as it doesn't upset any other programs) you might need to change the setting for the decimal point on the computer. Hope this helps Shane.
Re: SCAN FROM STRING
Hi Wiebe, I did not know that. I thought that this was maybe just in LV 7.0, but I just looked in my LV version (6.1) and wow, it's there. I never knew that. Thanks for the info. Shame I can't give your post a rating I have encountered this problem quite a lot, and this will help solve many problems in future. I've been programming for 10 years, know LabVIEW really well, but things like this really makes the developer Zone priceless. Shane.
Re: SCAN FROM STRING
OK, I had a look at the help for LV 6.1, but saw nothing about %p. You also haven't explicitly mentioned how this works in your original message. Can you give me an example of this (textual will do) so that I can try it out? What does the %p option do? Thanks Shane.
Re: SCAN FROM STRING
Aha. That's interesting to know. I don't suppose it works scanning from a String? Thanks again Shane.
Re: Scan from String and Read from spreadsheet not working
Herbert KOLTSCHIK wrote: Hello Marco, what character are you using as decimal point in your text file (dot . or comma ,)? Normaly I use the dot .. But you're right, LabView wants a in some fields instead of a dot! If the language (English or German or something else) country setting of the operating system and the language of LabView do not match this can lead to the problems you described! The Problem is, that I'm Swiss-German. We normally use the dot als decimal-sign. But in Labview (English Version on a german Win98 with Swiss-German Settings and Keyboard-Layout) I have to use the comma (which isn't on my numeric pad!). But both settings did not work :-( This is one reason why I always use English Windows with English LabView. That's not allways possible :-( I'm using German and English versions of the Operating-Systems. Argls! Now it works! Thank you for the Tipp! For me, this behaviour is definitely a bug! Especially on a swiss-german system, where the dot is the decimal separator (set this way in the system properties too!) Thanx for the help, now I can just read in the file, which is created by an external tool, change all the dots to comma and hope it works. Maybe it won't work then on my other machine which has an English Windows NT installed... GREAT! Marco
Re: Scan from String and Read from spreadsheet not working
Marco Tedaldi [EMAIL PROTECTED] wrote; I've got LabView 7 in which I want to read in umbers from a text file (one column of floating point values, between 0 and 1) With the format-string %.3f oder %.6f it allways gets the right number of values (there are 9 Values in the file, and I get an array of 9 Values), but all the values are zero (type: single)! When I change 0.x to 1.x in the file, I get 1.000 (instead of 1.x)! If this is a problem with the , and . as decimal seperator then i have some suggestions. Normally LabVIEW uses the Regional Settings (at least in Windows). 1 - You can override the regional settings in menu Tools-Options... Select the Front Panel options and uncheck the entry Use localized decimal point It will now use . as decimal seperator. 2 - Scan from String and Format Into string %.; will set . as decimal seperator %,; will set , as decimal seperator %; will use system settings. Search in online help index after Formatting and select entry specifier syntax in strings -- Rolf