Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Form1.ClientHeight -- Integer and Strings?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Tue Jul 03, 2007 5:31 am    Post subject: Form1.ClientHeight -- Integer and Strings? Reply with quote

i want to be able to set the 1st forms Height and width.

Code:

procedure TForm2.Button1Click(Sender: TObject);
begin
form1.clientheight:= ('edit1.text');
end;

end.

-but it says Incompatible types: 'Integer' and 'String'

i want to do so you can enter your height/width in edit1 and edit2 and as many times as you want.

i did this yesterday. but now i dont remember what i did more than this...
Back to top
View user's profile Send private message MSN Messenger
compactwater
I post too much
Reputation: 8

Joined: 02 Aug 2006
Posts: 3923

PostPosted: Tue Jul 03, 2007 7:26 am    Post subject: Reply with quote

Because you're trying to set the height to 'edit1.text'
What you want to do is
form1.clientheight:= StrToInt(edit1.text);
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Tue Jul 03, 2007 7:29 am    Post subject: Reply with quote

yes. thanks Very Happy

but how can i set a limit on? i did this too yesterday but i dont remember now O_o

example: Limit is 700, when you type in 701 you get an error message "To big" and then it goes back to what it was before/goes to 700.
Back to top
View user's profile Send private message MSN Messenger
compactwater
I post too much
Reputation: 8

Joined: 02 Aug 2006
Posts: 3923

PostPosted: Tue Jul 03, 2007 7:31 am    Post subject: Reply with quote

if StrToInt(Edit1.Text) >= 700 then
ShowMessage('Must be lower than 700.')
else
form1.clientheight:= StrToInt(edit1.text);
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Tue Jul 03, 2007 7:39 am    Post subject: Reply with quote

yes, but it still goes to whatever you write before it shows the message. so you can set it to 900, then it shows the message but stays at 900. doesnt go back to 700/whatever it was before.
Back to top
View user's profile Send private message MSN Messenger
compactwater
I post too much
Reputation: 8

Joined: 02 Aug 2006
Posts: 3923

PostPosted: Tue Jul 03, 2007 8:11 am    Post subject: Reply with quote

if StrToInt(Edit1.Text) >= 700 then //Check if it is 700 or greater
ShowMessage('Must be lower than 700.')//Tell the person
else//If it is NOT 700 or greater
form1.clientheight:= StrToInt(edit1.text);//Set the client height


That wouldn't do anything to the height if it was 700 or greater...
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Tue Jul 03, 2007 8:25 am    Post subject: Reply with quote

i removed the ShowMessage and just put

if StrToInt(Edit1.Text) >= 700 then
form1.clientheight:= StrToInt ('700')
else
form1.clientheight:= StrToInt(edit1.text);

it dont show a message, but it doesnt go over 700. thanks again compact.
Back to top
View user's profile Send private message MSN Messenger
magicalimp
Expert Cheater
Reputation: 0

Joined: 03 Dec 2006
Posts: 105

PostPosted: Tue Jul 03, 2007 9:49 pm    Post subject: Reply with quote

This code is so horrible: form1.clientheight:= StrToInt ('700')
Back to top
View user's profile Send private message
compactwater
I post too much
Reputation: 8

Joined: 02 Aug 2006
Posts: 3923

PostPosted: Wed Jul 04, 2007 5:13 am    Post subject: Reply with quote

magicalimp wrote:
This code is so horrible: form1.clientheight:= StrToInt ('700')


What he's saying, is he wants to choose the clientheight thru an edit box.
And your code has '700' as a string. (Unnecessary)
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Wed Jul 04, 2007 5:32 am    Post subject: Reply with quote

yea, and now i got so if you go higher than 700, lets say you enter 800. then it automaticly goes back to 700.
Back to top
View user's profile Send private message MSN Messenger
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Wed Jul 04, 2007 5:46 am    Post subject: Reply with quote

Code:
myInteger:=StrToInt(edit1.text);
if myInteger>700 then
  myInteger:=700;
Form1.ClientHeight:=myInteger;

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites