Sorry, the SIZE is 40 characters....
You want the length of valid data (and who is to say trailing blanks are not valid).
You will have to unstring the data or examine tallying the data with your own rules for defining 'what is valid data and where does it end' to determine the length.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
One way to get what you want is to redefine the field as an array, point to the right-most character, and compare if a space. If it is a space, decrement the pointer and check again. When you come to the first non-blank byte, the value in the pointer is the "length" of the data. This will accomodate embedded spaces which is common in name fields.