Piccoro, sorry for my previous information. Something was missing. In fact, both versions work the same:
* strinchar = "test )after)r" positionlen = (InStr(strinchar, ")", -1) - 1) Print strinchar Print positionlen strinchar = Mid(strinchar, 1, positionlen) Print strinchar strinchar = "test )after)r" strinchar = Mid(strinchar, 1, (InStr(strinchar, ")", -1) - 1)) Print strinchar * Both print "test )after" - fernando 2017-07-28 22:02 GMT-03:00 Adrien Prokopowicz <adrien.prokopow...@gmail.com> : > > Le Sat, 29 Jul 2017 02:40:44 +0200, Jussi Lahtinen < > jussi.lahti...@gmail.com> 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.lahti...@gmail.com >> > >> wrote: >> >> Hmmm... sorry, no mistake... I will look closer. >>> >>> >>> Jussi >>> >>> On Sat, Jul 29, 2017 at 3:33 AM, Jussi Lahtinen < >>> jussi.lahti...@gmail.com> >>> 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 < >>>> mckaygerh...@gmail.com> 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=97ed16795393aa3b689 > 13025e5d2b83c . > > 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 > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Fernando Cabral Blogue: http://fernandocabral.org Twitter: http://twitter.com/fjcabral e-mail: fernandojosecab...@gmail.com Facebook: f...@fcabral.com.br Telegram: +55 (37) 99988-8868 Wickr ID: fernandocabral WhatsApp: +55 (37) 99988-8868 Skype: fernandojosecabral Telefone fixo: +55 (37) 3521-2183 Telefone celular: +55 (37) 99988-8868 Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos, nenhum político ou cientista poderá se gabar de nada. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user