Deleting everything after a space in a string
Posted on 2003-02-26
Ok here's the problem.
I have loaded a filelist from a textfile into a listbox and then I use this code to parse the selections into a textbox and then using a shell command to use the filenames in an external program.
Private Sub Command2_Click()
Dim sText As String
Dim lListLoop As Long
For lListLoop = 0 To .ListCount - 1
If .Selected(lListLoop) = True Then
sText = sText & " " & .List(lListLoop)
Text1.Text = sText
Shell "program.exe " Text1
This works fine, but now when I added file sizes to the list I have a little problem.
The list looks like this.
The thing is, when parsing this to the Textbox the filesizes is added too, and that won't work when the shell command is executed since the program only accepts filenames and not sizes.
So I would like to use a command that deletes the filesizes when moving the list to a textbox.
Thanks in advance.