|
-
Feb 18th, 2000, 07:31 AM
#1
Thread Starter
Member
I'm using the common dialog class module in my program and it works great, except for one thing... The FileName that it returns contains extra characters at the end of the string. A 22 character string becomes 261 characters. The class module uses the Trim function to cut out extra spaces but these extra characters aren't spaces. They're Char(0) (space is Char(32) i think). Am I doing something wrong?
I do this:
Dim CommonDialogAPI as clsOpenSave
Private Sub Command1_Click()
Dim SaveBox as clsOpenSave
Set SaveBox = CommonDialogAPI
more code here...
End Sub
I use the dialog box to allow the user to select an external editor. The external editor path is save to the registry and loaded in FormLoad. It works after it is loaded from the registry but it doesn't work if the user changes it. Apparently, saving to the registry clips out the non-Windows characters. Is there a better way to get rid of Char(0) than repeatedly saving to the registry? Thanks in advance.
-
Feb 18th, 2000, 10:36 PM
#2
Junior Member
You probably tought about this one, but that is the way I do it and the only way I have found out...
Dim myStr$, pos%
'code goes here
pos = InStr(myStr, Chr(0))
If pos <> 0 Then
myStr = Left(myStr, pos - 1)
End If
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
|