|
-
Jun 26th, 2000, 12:44 AM
#1
Thread Starter
Lively Member
I have couple data want to save it into a txt file, but it's very hard to aligh it, because the length of data are different, so I am thinking if I can fix the length of them, it will be much easier to format my txt file.
like fix length to 10:
"John" will become "John "
add space to it.
is there any function can do this?
or do you have better sugestions?
Thanks
Cerebrate
-
Jun 26th, 2000, 01:07 AM
#2
Addicted Member
Look up the Trim property in VB Help
-
Jun 26th, 2000, 01:26 AM
#3
_______
not trim...
it's fixed length strings.
Type Record
strName as string * 10
End Type
'all records in strname will take 10 spaces
'all records saved will occupy 10 spaces
I haven't realy played with this..just once in
school...for fixed lenght I use an Access Data Base
hope it helps you in some way.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 26th, 2000, 01:47 AM
#4
Fixed-lengths strings are a good choice. Alternatively, you could use the Format$ function, like this:
strField = Format$("whatever", "!@@@@@@@@@@")
In the Format$ function, "at" signs (@) will normally right-justify an item in a field of that many positions (i.e., 10 @ signs = 10-position output area). By placing an exclamation point (!) in front of the @ signs, you force the data to be left-justified.
"It's cold gin time again ..."
Check out my website here.
-
Jun 26th, 2000, 02:06 AM
#5
Monday Morning Lunatic
use the str$(length, character) function.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|