[Gambas-user] why this could not be? error in runtime?

Adrien Prokopowicz adrien.prokopowicz at ...626...
Sat Jul 29 03:02:17 CEST 2017


Le Sat, 29 Jul 2017 02:40:44 +0200, Jussi Lahtinen  
<jussi.lahtinen at ...626...> a écrit:

> No... again. My initial mail was correct. It should be:
> strinchar = Mid(strinchar, 1, (InStr(strinchar, ")", -1) - 1))
>
> But the IDE makes highlighting bug with the brackets.
>
>
> Jussi
>
> On Sat, Jul 29, 2017 at 3:33 AM, Jussi Lahtinen  
> <jussi.lahtinen at ...626...>
> wrote:
>
>> Hmmm... sorry, no mistake... I will look closer.
>>
>>
>> Jussi
>>
>> On Sat, Jul 29, 2017 at 3:33 AM, Jussi Lahtinen  
>> <jussi.lahtinen at ...626...>
>> wrote:
>>
>>> Because the line makes no sense at all. Try to remove ")".
>>>
>>>
>>> Jussi
>>>
>>> On Fri, Jul 28, 2017 at 11:55 PM, PICCORO McKAY Lenz <
>>> mckaygerhard at ...626...> wrote:
>>>
>>>> in the following code:
>>>>
>>>>     strinchar = Mid(strinchar, 1, InStr(strinchar, ")", -1) - 1)
>>>>
>>>> IDE said error invalid argument, but if i do:
>>>>
>>>>     psotionlen = InStr(strinchar, ")", -1) - 1
>>>>      strinchar = Mid(strinchar, 1, psotionlen)
>>>>
>>>> works, why?
>>>>
>>>> i wnat to remove the last occurence of a char but bybass some possible
>>>> spaces/chars at the end of string
>>>>
>>>> Lenz McKAY Gerardo (PICCORO)
>>>> http://qgqlochekone.blogspot.com

Actually, his original code is correct. For me it runs without error in  
the IDE using
the 3.10 development version, but the editor is indeed having trouble  
matching the
parentheses.

I also tried it on the playground (which also uses 3.10) and it works
fine :  
https://gambas-playground.proko.eu/?gist=97ed16795393aa3b68913025e5d2b83c .

However the playground's editor does match the parentheses correctly. :)

Which Gambas version are you using ? There may be an old bug here.

-- 
Adrien Prokopowicz




More information about the User mailing list