Fixed Length Strings

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
Fixed Length Strings

Post by Guest » Thu Jul 17, 2003 10:55 pm

HELP!
I need Dimensioned Fixed-Length Strings!!
Anyone know if/how this can be done??
ie: NAME$(50) needs to be only 25 Chars long instead if 32767 ...

User avatar
frankiebaby
Global Moderator
Posts:95
Joined:Tue Apr 30, 2002 1:38 am
Location:Pennsylvania
Contact:

Re: Fixed Length Strings

Post by frankiebaby » Fri Jul 18, 2003 2:20 am

I beleive that

DIM NAME (50) AS STRING * 25

should do the trick, but you lose the convenience of the string identifier, so NAMESTR may be a better name, mainly because NAME is a reserved word.

Guest

Re: Fixed Length Strings

Post by Guest » Sat Jul 19, 2003 4:07 am

Thanks!
Worked like a charm!

Post Reply