I’m trying to concatenate two properties into one string like so:
public class thing
public property word() as string()
public property count() as integer()
end class
Public class myApp
dim a_thing as new thing
redim a_thing.word(upperBnd)
redim a_thing.count(upperBnd)
'I go on to fill the a_thing.word and .count arrays
'Then I try to display the results...but it doesnt work.
for i=0 to a_thing.word.length-1
debug.writeline("Word: " & a_thing.word(i) & " Count: " & a_thing.count(i))
next
end class
The for statement just displays:
Word: [the_word_in_the_array] Word: [the_word_in_the_next_index] ...etc,
with no new lines…
If I turn this into two debug.writeline statements, I get:
Word: [the_word_in_the_array] Count: [the_count_in_the_array]
This is what I want, but it doesn’t help that its in the debug output…I need to put it into a single string. I’ve tried using a_thing.count(i).tostring, but it doesnt work. If I look at the arrays individually, they have exactly the contents I want. But I can’t concatenate them. Whats going on here? Does it have something to do with suppressing the new line that debug.writeline usually creates?
Check to see if there are Null characters at the end of the words in the Word array. That would cause the behaviour that you’re seeing