|
-
Jan 28th, 2003, 05:30 PM
#1
Thread Starter
Junior Member
String Manipulation question...
Hey again... i have a little question.
I have a textbox that has returns at the end of the text, the ammount depending on the number of times the text has been saved.... there is a problem in the save code i'm using because it saves an extra return at the bottom of the text, causing the returns to build up. I need soem kind of string manipulation loop like trim() but instead of spaces, it deletes the returns at the end. I'm still learning VB, so i hope you guys have patience... what would be the most proficient way in doing this? Thanks
-
Jan 28th, 2003, 05:49 PM
#2
-
Jan 28th, 2003, 06:16 PM
#3
Thread Starter
Junior Member
Open App.path + "\current.txt" For Output As #1
Print #1, Form1.txtdemo.text
Close #1
Else
End If
I'm using that as an autosave, and returns are building up... i'm pretty sure its the save code, but its really basic... heres the load code i'm using
Dim filelength$
Dim var1$
If FileExists(App.path + "\current.txt") Then
Open App.path + "\current.txt" For Input As #1
filelength = LOF(1)
var1 = Input(filelength, #1)
Form1.txtdemo.text = var1
Close #1
-
Jan 28th, 2003, 06:38 PM
#4
Addicted Member
instead of
put
VB Code:
SaveFile Mid(Text1.Text, 1, Len(Text1.Text)-1)
or i think a return might be two spaces so you might need this:
VB Code:
SaveFile Mid(Text1.Text, 1, Len(Text1.Text)-2)
would that work?
-
Jan 28th, 2003, 07:00 PM
#5
Thread Starter
Junior Member
Yep! Thanks a lot flip, i used that and edited the load code and it now works! I'm pretty sure it was your input though, thanks a lot!
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
|