[Gambas-user] Bizarre results when entering a £ symbol into a TextArea or TextBox

Jussi Lahtinen jussi.lahtinen at ...626...
Tue Mar 17 16:50:11 CET 2015


Oh I missed you are using Mid() function, it is only for ASCII characters,
use String.Mid() instead.


Jussi

On Tue, Mar 17, 2015 at 4:33 PM, John Rose <john.aaron.rose at ...626...>
wrote:

> On 17/03/15 13:33, Jussi Lahtinen wrote:
> > Maybe the console takes only ASCII characters?
> >
> >
> > Jussi
> >
> > On Tue, Mar 17, 2015 at 3:00 PM, John Rose <john.aaron.rose at ...626...>
> > wrote:
> >
> >> When entering a £ character (i.e. the British pound symbol not the
> >> American one) into a TextArea or TextBox, it seems to be 'interpreted'
> >> as a funny looking question mark (i.e. sort of reverse black & white)
> >> when it's shown on the Console using a Print statement (actioned in a
> >> Change event). I wonder if this could be due to Gambas/Ubuntu regarding
> >> my keyboard as American even though it's 'installed' within Ubuntu as
> >> British.
> >>
> >> --
> >>
> >> John
> >>
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Dive into the World of Parallel Programming The Go Parallel Website,
> >> sponsored
> >> by Intel and developed in partnership with Slashdot Media, is your hub
> for
> >> all
> >> things parallel software development, from weekly thought leadership
> blogs
> >> to
> >> news, videos, case studies, tutorials and more. Take a look and join the
> >> conversation now. http://goparallel.sourceforge.net/
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >>
> >
> ------------------------------------------------------------------------------
> > Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> > by Intel and developed in partnership with Slashdot Media, is your hub
> for all
> > things parallel software development, from weekly thought leadership
> blogs to
> > news, videos, case studies, tutorials and more. Take a look and join the
> > conversation now. http://goparallel.sourceforge.net/
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> I don't think that it's caused by Print statements to the Console. When
> I amend the Change event coding (see below) for the TextArea and run the
> app with just a £ character keyed into the TextArea, I get on the
> Console (with the £ character displayed OK in the TextArea):
> X
> sCh=�
> Y
> ZZ
> *
> ***
>
> The coding is:
>   Dim i As Integer
>   Dim sCh As String
>   For i = 1 To PrintedTextArea.Length
>     sCh = Mid(PrintedTextArea.Text, i, 1)
>     Print "sCh=" & sCh
>     Print "X"
>     Print "sCh=" & sCh
>     Print "Y"
>     sCh = Mid(Last.Text, i, 1)
>     Select sCh
>       Case "£", "?", "&", ".", "/", "="
>         Print "Z"
>       Case Else
>         Print "ZZ"
>     End Select
>     Print "*"
>   Next
>   Print "***"
>
> Which implies that the above Select statement is not recognising an
> input £ as it is regarded it as the funny question mark when input into
> the TextArea. Looking at www.asciitable.com, Chr(35) is # which I would
> assume that Ubuntu should regard as a £ on a British keyboard.  There
> seems to be a bug: either on Ubuntu or Gambas. Which is it?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list