OSCAT Forum

oscat.lib => Bestehende Module / Existing Modules => Thema gestartet von: Pessimister am 29. August 2010, 21:39:08

Titel: BUFFER_SEARCH must return -1 when STR is not found
Beitrag von: Pessimister am 29. August 2010, 21:39:08
Hello all!

I wondered that BUFFER_SEARCH function returns 0 in both cases:

V := _STRING_TO_BUFFER('Same string', 0, ADR(BUF), SIZEOF(BUF));
POS := BUFFER_SEARCH(ADR(BUF), SIZEOF(BUF), 'Same string', 0, 0);

Function results 0.

V := _STRING_TO_BUFFER('Other string', 0, ADR(BUF), SIZEOF(BUF));
POS := BUFFER_SEARCH(ADR(BUF), SIZEOF(BUF), 'Same string', 0, 0);

Function results 0 too.
Titel: Re:BUFFER_SEARCH must return -1 when STR is not found
Beitrag von: hugo am 19. Januar 2011, 13:52:14
buffer search will be updated in the next release and will correctly return -1 if nothing is found