  | 
				
				Cheat Engine The Official Site of Cheat Engine   
				
 
				 | 
			 
		 
		 
	
		| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		Madman I post too much
  Reputation: 1
  Joined: 04 May 2006 Posts: 3978
 
  | 
		
			
				 Posted: Wed May 09, 2007 7:16 pm    Post subject: delphi help | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Code: | 	 		  unit Unit1;
 
 
interface
 
 
uses
 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 
  Dialogs, StdCtrls, ComCtrls;
 
 
type
 
  TForm1 = class(TForm)
 
    ProgressBar1: TProgressBar;
 
    Button1: TButton;
 
    Edit1: TEdit;
 
    procedure Button1Click(Sender: TObject);
 
  private
 
    { Private declarations }
 
  public
 
    { Public declarations }
 
  end;
 
 
var
 
  Form1: TForm1;
 
 
implementation
 
 
{$R *.dfm}
 
 
procedure TForm1.Button1Click(Sender: TObject);
 
begin
 
if edit1.text := 'your awesome'
 
then edit1.text := 'no you are!'
 
else edit1.Text := 'sorry, try again!'
 
end;
 
 
end.
 
 | 	  
 
 
in the procedure button1click, why do i get a boolean error with 'then'?
 
im sorry, ive never done tuts on delphi, im really just learning it from trial and error.
 
thanks.
 
 
EDIT!!!!
 
DOHH!!! ROFL I JUST SAW I WAS TRYING TO DO THAT WITH A BUTTON CLICK! GAAAHHAHA   
 _________________
  | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		appalsap Moderator
  Reputation: 0
  Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
  | 
		
			
				 Posted: Wed May 09, 2007 7:30 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				:= means ASSIGN
 
= means COMPARE
 
 
so
 
 
 
 
will always evaluate as true.
 
Correct way is
 
 
 | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		Madman I post too much
  Reputation: 1
  Joined: 04 May 2006 Posts: 3978
 
  | 
		
			
				 Posted: Wed May 09, 2007 7:31 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				oh thanks!
 
that actually answered another problem im having now that i realized it was a button
 
edit:
 
 
umm... i dont see how i should have it with the ='s and :='s...
 
 
 	  | Code: | 	 		  
 
begin
 
if edit1.Text = 'You are'
 
or edit1.text := 'You Are!'
 
or edit1.Text := 'you are'
 
then button1.Caption := 'Yes I am!'
 
else button1.caption := 'Sorry, Thats Wrong...'
 
end;
 
 | 	  
 
 
EDIT EDIT EDIT
 
i have minimized the problem to being the "or"s... how do i get them to work?
 
 
POPOOPOPOPPPOOP
 
 
SUPER SUPER DUPER EDIT
 
SUPER SUPER DUPER EDIT
 
SUPER SUPER DUPER EDIT
 
SUPER SUPER DUPER EDIT
 
 
W00t i fixed it all by myself!
 
turns out i needed to do this....
 
 
 	  | Code: | 	 		  begin
 
if edit1.Text = 'you''me'
 
then label1.Caption := 'YEP, ME AND ONLY ME!'
 
else label1.caption := 'LOL! YEAH RIGHT!'
 
end; | 	  
 
to make it work right!
 
thanks for the := and = things appal!
 _________________
  | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  | 
   
 
		 |