Subject udf & classic server
Author huhusven
hi there

did my 2 hours google & wondering ..

setup:
version 1.5 r7 on windows (xp)
classic server

situation:
i've got an udf (quoted below) that is in use and working fine in a
super server environment. meaning it is thread-save and shiny. now for
some reasons i changed to the classic server setup. result: i get the
error (in my delphi application)
"Error reading data from the connection"

thoughts:
that error probably means, that there is no data (but there is), that
there is no connection (network fine), that ... hmpf.

question:
why would the change to classic environment cause problems with this udf??

many thanks (even if i now learn i'm stupid after all ...:-)
sven


quoted udf:

// call: INSTR ('A|B|C|D|E|F|', '|', 3, 2), returns 6
// Value is a string, built from elements
// Zeichen is a delimiter
// Startpos first character in Value counting from 0 (would point at
'|', meaning 'C')
// nte n'th element after Startpos (second after 'C', thus 'D')
// returns: position of 'D' in Value, counting from 0
FUNCTION InStr(Value: PChar; Zeichen: PChar; var StartPos, nte:
smallint): integer; stdcall;
var
i, f: integer;
S, Devider: String;
begin
S := Value;
Devider := Zeichen;
S := Copy(S, StartPos, Length(S)-StartPos+1);
Result:=StartPos-1;
for i:=1 to nte do begin
f:=Pos(Devider, S);
if f>0 then begin
S:=Copy(S,f+1, Length(S)-f+1);
Result:=Result+f;
end
else begin
Result:=0;
Break;
end;
end;
end;