Jump to content
357mag

Delphi says "x is not a valid integer value"

Recommended Posts

8 hours ago, microtronx said:

simply change your line from


  x := StrToInt('x');

to


  x := StrToInt(inttostr(x));

crazy, but will work. But I do not understand why someone would do this :classic_biggrin:

In that case, you could just get rid of the offending StrToInt() altogether:

procedure TFormSimpleVariable.ButtonShowValueClick(Sender: TObject);
begin
  //x := StrToInt('x');
  LabelResult.Caption := 'The value of x is ' + IntToStr(x);
end;

But that doesn't jive with what @357mag is asking for in the first place.

Edited by Remy Lebeau

Share this post


Link to post
16 hours ago, Remy Lebeau said:

In that case, you could just get rid of the offending StrToInt() altogether:


procedure TFormSimpleVariable.ButtonShowValueClick(Sender: TObject);
begin
  //x := StrToInt('x');
  LabelResult.Caption := 'The value of x is ' + IntToStr(x);
end;

But that doesn't jive with what @357mag is asking for in the first place.

Yes I know, but I was unable to fully comprehend the question.

Edited by microtronx

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×