[Gambas-user] String and textboxes
Rolf-Werner Eilert
eilert-sprachen at ...221...
Thu Mar 10 08:30:38 CET 2011
Am 08.03.2011 20:11, schrieb k p:
>> When doing the following:
>> TextLabel1.Text = "i"& TextBox1.Text& ""& " iEQU"& ""& "0"
>>
>> I expect a string in a text box, which I get.
>> However the length of the spacing stays the same no matter how many spaces
> I
>> put between the " "
>>
>> What I'm trying to achieve is that the output string follows my coding
>> standard.
>> Ie if I write Callbutton in TextBox1, then the output shows
>> "iCallbutton iEQU 0"
>>
>> What am I doing wrong ?
>>
>> Kim
>
>
> I'm not sure what you exactly do here in your program, but your example
> above consists of string constants. You would have to vary the number of
> spaces according to the length of the strings in TextBox1.Text, such as
>
> space$(20 - string.len(TextBox1.Text))
>
> to give just an example for UTF-8.
>
> Or did I get you completely wrong here?
>
> Regards
>
> Rolf
>
>
>
> What is happening is that white spaces does NOT change in the output
> textbox, no matter how many white spaces I put in between the " ".
> Ie " " and " " produces the same output in the text box.
>
> So I get the following
> "iCallbutton iEQU 0"
>
> When I would expect this
> "iCallbutton iEQU 0"
>
> Hmm
>
> Kim
Ok, that is a strange one! I'm using Gambas 2 here, there is no problem.
Maybe there's something wrong in the way UTF-8 strings are handed to the
textbox? But that would be something for Benoit - he's in charge of the
inner mystiques of the Gambas system ;-)
No: Just had this idea: Is the textbox a richtext-box? And could it be
that it interprets white spaces as mere words-separating according to
HTML? So that would explain it. Try " " or
" " instead, does it help?
Rolf
More information about the User
mailing list