07-24-2006 07:57 PM
07-25-2006 12:56 AM
You need to revise exactly the dimension of your strings: given this error either bb is too short for some of the elements to format into or the destination string cannot hold all substrings appended to it.
You could also try excluding the use of an intermediate string to format data, for example using sprintf (dataResult, "%s %0.2x", dataResult, dataSource[i]); dataResult string needs to be inizialized to an empty string at the beginning of the function.
Also, when the error arise, you could examine in the Variables window the content of i, bb and dataResult to discover what's going on.
And don't forget that you could also use Fmt functions, that accepts variable-lenght arrays when formatting, using asterisks instead of repetition code and passing the size of the array as one of its arguments. This subject is extensively discussed in the Formatting and I/O library help.