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 


Delphi question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
jongwee
Moderator
Reputation: 0

Joined: 28 Jun 2006
Posts: 1388
Location: Singapore

PostPosted: Thu Dec 06, 2007 3:15 am    Post subject: Delphi question Reply with quote

Hi, I'd like to ask a simple question.
If I have integers, for example:
Code:
a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
f:integer;


And I want to have a string which is the addition of all this strings, in C++, its just
Code:
a = b+c;

But if in delphi? And if I am going to display the value of a (The string), how do I go around doing it?

Thanks

_________________
Back to top
View user's profile Send private message MSN Messenger
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Thu Dec 06, 2007 3:38 am    Post subject: Re: Delphi question Reply with quote

jongwee wrote:
Hi, I'd like to ask a simple question.
If I have integers, for example:
Code:
a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
f:integer;


And I want to have a string which is the addition of all this strings, in C++, its just
Code:
a = b+c;

But if in delphi? And if I am going to display the value of a (The string), how do I go around doing it?

Thanks

a := IntToStr(b + c + d + e + f)
I think.

_________________
haxory' wrote:
can't VB do anything??
windows is programmed using VB right? correct me if im wrong.

so all things in windows you have like the start menu is a windows form too.
Back to top
View user's profile Send private message
Lewiathan
How do I cheat?
Reputation: 0

Joined: 06 Dec 2007
Posts: 5

PostPosted: Thu Dec 06, 2007 12:37 pm    Post subject: Re: Delphi question Reply with quote

Xenephobe wrote:
jongwee wrote:
Hi, I'd like to ask a simple question.
If I have integers, for example:
Code:
a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
f:integer;


And I want to have a string which is the addition of all this strings, in C++, its just
Code:
a = b+c;

But if in delphi? And if I am going to display the value of a (The string), how do I go around doing it?

Thanks

a := IntToStr(b + c + d + e + f)
I think.


Not exactly,
'a' is variable type integer
Code:
a:integer;
,
but function IntToStr return string variable.

My suggestion is:
declare another string variable, eg:
Code:
sumstr:String;


after:
Code:
sumstr:=IntToStr(b + c + d + e + f);


or:
Code:
sumstr:=format('%d',[b + c + d + e + f]);


Last edited by Lewiathan on Thu Dec 06, 2007 1:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Dec 06, 2007 1:07 pm    Post subject: Reply with quote

Code:
var
a,b,c,d,e,f,sum:integer;
begin
//your code here that scans for the number
sum:=a+b+c+d+e+f;
ShowMessage(StrToInt(sum)); //result
end;
Back to top
View user's profile Send private message
Lewiathan
How do I cheat?
Reputation: 0

Joined: 06 Dec 2007
Posts: 5

PostPosted: Thu Dec 06, 2007 1:18 pm    Post subject: Reply with quote

Kaspersky wrote:
Code:
var
a,b,c,d,e,f,sum:integer;
begin
//your code here that scans for the number
sum:=a+b+c+d+e+f;
ShowMessage(StrToInt(sum)); //result
end;


hmm,
rather:
Code:
ShowMessage(IntToStr(sum)); //result

Very Happy
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Dec 06, 2007 1:25 pm    Post subject: Reply with quote

Fuck, i ment IntToStr rofl, wow... i must be drunk Laughing
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Thu Dec 06, 2007 5:50 pm    Post subject: Reply with quote

You don't really have to declare 'sum' unless you are going to use that value again.

ShowMessage(IntToStr(a + b + c + d + e + f)); works too.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Fri Dec 07, 2007 7:13 am    Post subject: Reply with quote

rapion124 wrote:
You don't really have to declare 'sum' unless you are going to use that value again.

ShowMessage(IntToStr(a + b + c + d + e + f)); works too.


if course not, it'll be clearer.
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