Re: Int and Str usage
Posted by webmaster Guido on June 16, 2003 at 18:15:03:
In Reply to: Re: Int and Str usage posted by Joey on June 12, 2003 at 19:51:40:
: The code up above generated the following errors:
: [Error] Unit1.pas(33): Incompatible types: 'String' and 'Boolean'
: I just deleted the LowerCase statement (dint understand what it was making at).
Sorry... I'll never do that again, posting code without checking it in Delphi ;-)
procedure TForm1.Button1Click(Sender: TObject); var P, ErrCode: integer; begin ErrCode := 1; // LowerCase is used so that the user can type "populate:"... // ...as well as "POPULATE:" or "Populate:" if LowerCase(Copy(Edit1.Text, 1, 10)) = 'populate: ' then Val(Copy(Edit1.Text, 11, Length(Edit1.Text)), P, ErrCode); if ErrCode = 0 then Spinedit1.Value := P else Label1.Caption := 'Cheat Unkown or...'; end;
[ DelphiLand: free Delphi source code, tips, tutorials ]