[Gambas-user] String length of Key.Text

... d4t4full at ...626...
Wed Oct 14 02:38:58 CEST 2015


Ctrl is actually a modifier key. It just lowers (resets, or sets to zero) bit 6 (bit weight is 64 decimal) of the character it modifies.

For example, ASCII code 7 is BEL. It's represented by Ctrl-G. The ASCII code of G is 71. 71 - 64  = 7.

If you look for the ASCII code of W (87) and subtract 64 from it you will get the ASCII code for ^W (23, called "ETB" for "End of Transmit Block").

In short, what you get IS a single character represented VISUALLY by the combination of two (printable) characters.

Hope it helps,
zxMarce.



On Oct 13, 2015, 21:21, at 21:21, Moviga Technologies <moviga at ...3488...> wrote:
> 
>
>If I hit Ctrl+W on the keyboard, 'Debug Key.Text' prints '^W'. If I do
>'Debug String.Len(Key.Text)' this prints 1... I understand that ^
>represents Ctrl, but it is still a character?? Why is it not counted?  
>------------------------------------------------------------------------------
>_______________________________________________
>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