Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INSTR bug?
#3
(02-27-2023, 12:48 PM)GTC Wrote: I guess the recommendation will be to upgrade, but does anyone recall INSTR behaving badly?

Before posting here and claiming one of the older, extensively-used functions has a bug, you need to provide example code which proves your point. If you have to use the first integer parameter of INSTR(), which could be left out and then it's assumed to be one, the chance increases of it returning zero for perhaps being put far ahead in the string for the search to be of any consequence. Alternatively there is now _INSTRREV() which searches backward from the end of the string toward the beginning.

If the call to INSTR() in your code has three parameters and the first one is an integer variable you have to watch the value of that variable. It cannot be zero nor negative; I believe Q(uick)BASIC was supposed to return an Illegal Function Call there.
Reply


Messages In This Thread
INSTR bug? - by GTC - 02-27-2023, 12:48 PM
RE: INSTR bug? - by bplus - 02-27-2023, 01:32 PM
RE: INSTR bug? - by mnrvovrfc - 02-27-2023, 02:11 PM
RE: INSTR bug? - by GTC - 02-27-2023, 03:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Instr to count occurrences PhilOfPerth 5 958 04-29-2025, 11:17 PM
Last Post: TempodiBasic
  Using And with two InStr calls CMR 3 617 04-25-2025, 08:52 PM
Last Post: CMR
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 812 04-13-2025, 11:14 PM
Last Post: TDarcos
  Oldest QB45 bug ever known eoredson 13 2,438 07-31-2024, 03:07 AM
Last Post: eoredson
  DIM - AS - VARIABLE TYPE likely bug bartok 25 5,490 05-06-2024, 08:21 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)