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 help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Madman
I post too much
Reputation: 1

Joined: 04 May 2006
Posts: 3978

PostPosted: Wed May 09, 2007 7:16 pm    Post subject: delphi help Reply with quote

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 Laughing

_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Wed May 09, 2007 7:30 pm    Post subject: Reply with quote

:= means ASSIGN
= means COMPARE

so

Code:

if x := y then ...


will always evaluate as true.
Correct way is

Code:

if x = y then ...
Back to top
View user's profile Send private message
Madman
I post too much
Reputation: 1

Joined: 04 May 2006
Posts: 3978

PostPosted: Wed May 09, 2007 7:31 pm    Post subject: Reply with quote

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
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