Am 28.07.2017 um 22:55 schrieb PICCORO McKAY Lenz:

> in the following code:
> 
>     strinchar = Mid(strinchar, 1, InStr(strinchar, ")", -1) - 1)
> 
> IDE said error invalid argument, but if i do:

No, the IDE says nothing:

Public Sub Test()

  Dim strinchar As String
  Dim psotionlen As Integer

  ' ------------------------------------------------- 1
  strinchar = "strat)edn1"

  strinchar = Mid(strinchar, 1, InStr(strinchar, "u", -1) - 1)

  Print strinchar

  ' ------------------------------------------------- 2
  strinchar = "strat)edn1"

  psotionlen = InStr(strinchar, ")", -1) - 1
  strinchar = Mid(strinchar, 1, psotionlen)

  Print strinchar

  ' ------------------------------------------------- 3
  ' but the only thing this does is (AFAIK)

  strinchar = "strat)edn1"

  Print Left(strinchar, Len(strinchar) - 1)

End

Result is:

strat)edn
strat)edn
strat)edn

:-)

Maybe you should write and code a little slower. ;-)


Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
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

Reply via email to