>
> Bad example because Val() is a special case ! Val() function work with some
> help from the compiler, this way you can pass either an integer or a
> floating point variable as the second argument.
>

Oups i'm not lucky... :-)



> There is nothing in Delphi which is "nothing" for an integer or a floating
> point value.The closest is using variant instead of simple data types. A
> variant can be
> empty.You can also use a pointer.


Yes, yesterday.. i had an idea and it's was working...
I''ve used this and it's work fine :

Val(S, Integer(myV), myCode)

I don't know if it is the best way :-)

but thanks for this good info !

> Sorry but I don't clearly understand what you intend to do.
> Could you explain again, and give a complete example, even if it doesn't
> compile because of syntax error.


I've just got a component code on the net :
and because the Numcheck var is never used, i was trying to understand
why...

function TTestGrid.Sort : Boolean;
Var
   CheckForNum, NumCheck, NumErr : Integer;
begin
   ErrorCode := 0;
   ...

    For CheckForNum := FStartIndex TO FEndIndex DO  Begin
         If FHowToSort = stRow Then
            Val(Cols[FSortIndex].Strings[CheckForNum],NumCheck,NumErr)
         else
            Val(Rows[FSortIndex].Strings[CheckForNum],NumCheck,NumErr);
   End;
   ...
end;


Cédric
_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to