Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21266

[RESOLVED] What is the benefit of fixed-length string (as string * 14)?

$
0
0
I am working on an issue with our live vb6 application.

A field used to be of the format nn/nn/nn. So the variable to store it was "as string * 8".

Then our data changed and could possibly be nnn/nnn/nnn so truncation is occurring. Perhaps the easiest thing to do is change the code to "as string * 11". But am I just postponing the same problem from occurring again later, when the data become nnnn/nnnn/nnnn? (A change was made to increase the length almost five years ago, and here we are again...)

So what is the difference between these - MyString As String * 10 vs MyString As String? And I guess more importantly, is it because MyString is a field in a user defined type that you have to declare the length explicitly? That is,
Code:

Private Type MyType
    MyStringOne As String * 8
    MyStringTwo As String * 3 
    MyStringThree As String * 5
End Type

Private udtMyType As MyType


Viewing all articles
Browse latest Browse all 21266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>