[Gambas-user] Accessing characters of string as array

T Lee Davidson t.lee.davidson at gmail.com
Mon Nov 18 17:46:36 CET 2019


Oh my gosh. No wonder it doesn't work.

I just upgraded to the latest OpenSUSE Leap 15.1 and simply assumed the Gambas version would be recent. Ugh, it's version 3.10.


Sorry for the noise.


___
Lee


On 11/17/19 10:19 PM, Jussi Lahtinen wrote:
> Works here with development version.
> What is your version?
> 
> 
> Jussi
> 
> On Mon, Nov 18, 2019 at 4:29 AM T Lee Davidson <t.lee.davidson at gmail.com <mailto:t.lee.davidson at gmail.com>> wrote:
> 
>     The documentation for Mid() [0] says:
>     Using string like arrays (as known as "Boxed strings")
>     SINCE 3.12
>     You can get the contents of a string using the following array-like syntax:
> 
> 
>     Result = String [ Start As Integer [ , Length As Integer ] ]
>     --- end quote ---
> 
>     Nice. But the following causes the exception, "Not an object":
>     Public Sub Main()
> 
>         Dim s As String = "123456789"
> 
>         Print s[3, 1]
> 
>     End
> 
> 
>     Is this a bug, or am I misunderstanding the documentation?
> 
> 
>     ___
>     Lee
> 
>     [0] http://gambaswiki.org/wiki/lang/mid
> 
>     ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 


More information about the User mailing list