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] TCaption Character Array

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Rev.
How do I cheat?
Reputation: 0

Joined: 23 Jul 2008
Posts: 5

PostPosted: Sun Oct 05, 2008 5:02 am    Post subject: [Delphi] TCaption Character Array Reply with quote

I'm trying to set a specific character in a TCaption:
Code:
frmMain.lblWord.Caption[i] := C;

It generates error "E2064 Left side cannot be assigned to."
Back to top
View user's profile Send private message
bartil
Advanced Cheater
Reputation: 0

Joined: 11 Jul 2006
Posts: 91

PostPosted: Sun Oct 05, 2008 5:18 am    Post subject: Reply with quote

Code:
frmMain.lblWord.Caption := C[i];


Is this what you meant?
Back to top
View user's profile Send private message MSN Messenger
Rev.
How do I cheat?
Reputation: 0

Joined: 23 Jul 2008
Posts: 5

PostPosted: Sun Oct 05, 2008 5:20 am    Post subject: Reply with quote

bartil wrote:
Code:
frmMain.lblWord.Caption := C[i];


Is this what you meant?

No. C is a character already declared... I'm trying to set the character in lblWord's caption.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25989
Location: The netherlands

PostPosted: Sun Oct 05, 2008 5:24 am    Post subject: Reply with quote

caption is a property, and properties don't like reads and writes at the same time. (they either call the read function or the write procedure)

do this:
Code:

var temp: string;
...
temp:=frmMain.lblWord.Caption;
temp[i]:=C;
frmMain.lblWord.Caption := temp;

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Rev.
How do I cheat?
Reputation: 0

Joined: 23 Jul 2008
Posts: 5

PostPosted: Sun Oct 05, 2008 5:26 am    Post subject: Reply with quote

Dark Byte wrote:
caption is a property, and properties don't like reads and writes at the same time. (they either call the read function or the write procedure)

do this:
Code:

var temp: string;
...
temp:=frmMain.lblWord.Caption;
temp[i]:=C;
frmMain.lblWord.Caption := temp;

Yeah, I already knew I could just declare another string and use that... I just wanted to make sure if there wasn't something I could do to get the job done directly. Razz I'll go ahead and use it, it's not a big deal.
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