?
Solved

StrToInt question

Posted on 2007-08-03
5
Medium Priority
?
444 Views
Last Modified: 2013-11-05
Dear Experts,

procedure TConnectHost.ConClick(Sender: TObject);
begin
  if HostName.Text <> '' then
  begin
    ConnectHostName := HostName.Text;
    ConnectPortName := StrToInt(PortName.Text);   <======= put the text entered in the editbox
                                                                                                    in a variabele.

What do I have to put in de FormShow-event:

  ActiveControl := HostName;
  HostName.Text := ConnectHostName;
  IntToStr(PortName.Text) := ConnectPortName; <===this is not correct what the whright syntax?

Peter


......
0
Comment
Question by:peterkiers
  • 3
5 Comments
 
LVL 1

Author Comment

by:peterkiers
ID: 19627271
I got: [Error] Connectu.pas(43): Incompatible types: 'String' and 'Integer'
0
 
LVL 17

Assisted Solution

by:mokule
mokule earned 1000 total points
ID: 19627467
give Your variables definitions.
ConnectPortName suggests to be a string variable
if so
ConnectPortName := PortName.Text;

In any case
this won't be correct
IntToStr(PortName.Text) := ConnectPortName;
0
 
LVL 1

Author Comment

by:peterkiers
ID: 19627594
Sorry, i forgot to tell that ConnectPortName is an Integer.

With this line:
  PortName.Text := ConnectPortName;

I get the message:
I got: [Error] Connectu.pas(43): Incompatible types: 'String' and 'Integer'




0
 
LVL 19

Accepted Solution

by:
MerijnB earned 1000 total points
ID: 19627649
it's:

  PortName.Text := IntToStr(ConnectPortName);
0
 
LVL 1

Author Comment

by:peterkiers
ID: 19627686
Thanks for the help.

Gr,

Peter
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question