BUFFER_SEARCH must return -1 when STR is not found

Begonnen von Pessimister, 29. August 2010, 21:39:08

Vorheriges Thema - Nächstes Thema

0 Mitglieder und 2 Gäste betrachten dieses Thema.

Pessimister

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.

hugo

buffer search will be updated in the next release and will correctly return -1 if nothing is found