Hope you can help out a poor novice. I have a text file with a list of names separated by “,” and grouped using “;”. And this works great populating my listbox. I would like to use the same file to list the names in a combo box without the grouping aspect of the “;”. The code I have works except for the “;” which of course which gives this: Yellow-billed Loon;Red-necked Grebe. Just want the “;” to delimit like “,” in those cases. I tried a few things but nothing. Am I even thinking about it the right way? My code is below. Thanks
Dim s As String
Dim i, last As Integer
Dim f As folderItem
Dim TextIn As TextInputStream
dim myText As String
f=GetFolderItem(“Species File”)
////Get Species names
if f<>nil then
TextIn=TextInputStream.open(f)
myText=TextIn.readLine
s=myText
end if
////Parse Species name file
last = CountFields(s,",")
For i = 1 To last
Me.AddRow(NthField(s, “,”, i))
Next
Me.ListIndex = -1
// - get species names
if f <> nil then
textIn = textInputStream.open(f)
myText = textIn.readLine
myText = replaceAll(myText, “;”, “,”)
s = myText
end if
Rick and Michel, I do see what you mean. In this case the user won’t control what goes into the file. But I do have a field in my database where user commas will cause problems. Thanks.