keep white spaces in strings

MichaelTJ

Member
Licensed User
Longtime User
when i have the following situation...

X = 1
Y = 2
Z = 3

and do the following.....

dim ST1 as string
ST1 = X & " " & Y & ".........." & Z

the value of ST1 is returned as "1 2 ..........3"

how do i maintain the blank or "white" spaces between 1(X) and 2(Y)?
 

MichaelTJ

Member
Licensed User
Longtime User
hmmmm...

even this forum posting kills the white spaces....

within the ST1 string i need 10 blank spaces between the 1 and the 2
 
Last edited:
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
reply to "don't see problem"

with in the string ST1 i need ten blank spaces between the "1" and the "2" similarly to how there are ten periods between the "2" and the "3"..... i wrote the question that way but even this forum functionality killed the white spaces in my example
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
i will try that later today.... i was not keeping the spaces separated from other text as in & "......C" & so i will try & "......" & "C" (. represents blank)
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
am i STILL missing something?

locLineData = locTme & " " & locTYPE & " " & "P-" & locST2data

looks fine now but the forum will probably compress it so as to not be seen but.... there are six spaces between locTme and locTYPE and two spaces between locTYPE and "P-"

the value of locLineData however shows all but one of the 6 spaces removed and one of the two spaces removed so that there is but a single space between these items....

is there something else to try?
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
i see this "faulty" value by....

hovering over the locLineData while in the debug mofe..... the spaces are all adjusted from any number of spaces entered to but one space between values
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
more discovery....

the hovering never shows the spaces but the value displayed under "Local variables" is correct.... so it is just the hover function that has the problem? and not the actual value being assigned to the string variable.... thank you for your help with this
 
Upvote 0
Top