Hi,
I have a program where text to be displayed could be 1 or multiple lines. I want to display the text in a specific form and I have multiple forms for 1-line, 2-lines, 3-lines, etc.
All good as long as I know how many lines are being required.
In some cases though, I don't know that, so I need a way to count the number of line-feeds in a string. The string is build by concatenating multiple elements, for example:
msg_text = msg_text & " Year build : " & prod_year & Chr(13)
msg_text = msg_text & " Rent per active day : " & daily_rent & Chr(13)
etc.
The string (msg_text) is passed to a module that handles the display functionality.
In that module I tried to do a search for the first position on a line feed using >> pos = InStr(1, g_text, "Chr(13)") <<
I also tried to use VbNewLine instead of "Chr(13)", but both times no luck, i.e. pos is always 0.
Any ideas?
I have a program where text to be displayed could be 1 or multiple lines. I want to display the text in a specific form and I have multiple forms for 1-line, 2-lines, 3-lines, etc.
All good as long as I know how many lines are being required.
In some cases though, I don't know that, so I need a way to count the number of line-feeds in a string. The string is build by concatenating multiple elements, for example:
msg_text = msg_text & " Year build : " & prod_year & Chr(13)
msg_text = msg_text & " Rent per active day : " & daily_rent & Chr(13)
etc.
The string (msg_text) is passed to a module that handles the display functionality.
In that module I tried to do a search for the first position on a line feed using >> pos = InStr(1, g_text, "Chr(13)") <<
I also tried to use VbNewLine instead of "Chr(13)", but both times no luck, i.e. pos is always 0.
Any ideas?