You will know the first function as a FP supplied function.
function TryStrToInt( const s: string; out i: LongInt) : Boolean;
I would like a function that searches a table for an item and returns a boolean value. If true it puts a code in the "out" parm p. The table looks like the following.
AAAAAAA AAA
BBBBBBB BBB
DDDDDD DDD
So I would call:
Var
Valid : Boolean = False;
P String = '';
begin
Valid := TryValidEntry('DDDDD', P); //and get Valid = True and P = 'DDD'.
Or am I all wrong on this.
function TryValidEntry( const S : String; out P : String) : Boolean;
Thanks;