Re: Int and Str usage


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by Joey on June 12, 2003 at 19:51:40:

In Reply to: Re: Int and Str usage posted by webmaster Guido on June 11, 2003 at 22:27:12:

The code up above generated the following errors:

[Error] Unit1.pas(33): Incompatible types: 'String' and 'Boolean'
[Error] Unit1.pas(34): ')' expected but ',' found
[Error] Unit1.pas(34): Not enough actual parameters
[Error] Unit1.pas(35): Type of expression must be BOOLEAN
[Error] Unit1.pas(44): Statement expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

i got rid of some of the errors by deleting certain things but i dont realy know if there relative to the solution:

var
  P, ErrCode: integer;
begin
  if Copy(Edit1.Text, 1, 10) = 'populate: ' then begin
    Val(Copy(Copy(Edit1.Text, 11, Length(Edit1.Text), P, ErrorCode);
    if ErrCode = 0 then
      Spinedit1.Value := P;
  end     
  else
    Label1.Caption := 'Cheat Unkown or...';
end;

I just deleted the LowerCase statement (dint understand what it was making at).
And i little thing with the ErrcODE := 0 to " = 0... It would be realy helpful if you could help me ;) dont want to be a problem its just i was realy intrested in how this works.

Thanks Joey :)


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]