Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting string length in a Type Statement using a VBCrLf

Status
Not open for further replies.

SteveJR

Programmer
Aug 13, 2001
72
GB
Hi,

Can someone please advise if you can set a string length in a Type Statement by using a VBCrLf? For example, instead of

Code:
Type exampleType
  myString as String * 100
End Type

Can you do:

Code:
Type exampleType
  myString as String Until VBCrLf 'allows for a variable length string terminated by a VBCrLf
End Type

In the above I have used as VBCrLf as the terminating character but I assume you could use any as needed.

Many Thanks

Steve
 
hi,

use the Split function on the string like
Code:
Type exampleType
  myString as String * 100
End Type 
 
'......

myString = split(myString, vbCrLf)(0)


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top