08-27-2007 06:36 AM
08-27-2007 07:47 AM
to limit the allowed entry length of a string capture the string key down/key repete events and check the new values length, if too long write the old string to a local or property value of the string control. To fix the size of a string after entry, uos a componation of string length and string subset (to shorten strings) or concatinate (prepend n space characters to the string) You could even get fancy and do this all in an x control.
Paul
08-27-2007 02:53 PM - edited 08-27-2007 02:53 PM

Message Edited by smercurio_fc on 08-27-2007 02:54 PM
08-27-2007 03:13 PM
LabVIEW does not have a fixed lenght string datatype. If you want to pad entries to a fixed lenght, you need to decide what the pad character should be. When you are converting back from a spreadhseet string, you again need to be careful that the pad characters are not recognized as separators.
IF you really have an array of all fixed lenght strings of the same lenght in your file, you should consider a binary format for your files.
What is the lenght of each string? If is is e.g. only 8 charcacters, you could cast it to a U64 numeric, for example.
08-27-2007 03:39 PM
Correct, of course. I did not mean to imply that you actually got a fixed length string using the Byte Array to String. Only that you got strings of some arbitrary pre-determined length. The string itself can still vary.
LabVIEW does not have a fixed lenght string datatype.