Borland Delphi 7, help me out

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
Jdogg





Posts: 184
Joined: Thu Aug 31, 2006 3:18 pm

Borland Delphi 7, help me out

Post by Jdogg »

i have been using vb.net for too long.
i dont wanna do c#

so i chose delphi 7

could someone tell me simple things like

msgbox
DIM statement
IF statement

thanks! :roll: :roll:
User avatar
bcnipod





Posts: 3580
Joined: Tue May 15, 2007 8:52 am
Location: 45 Minutes outside Boston
Contact:

Post by bcnipod »

why don't you do Java or another C language?
Twitter: Dirk Gently | Major lulz
Mr. Brightside: Worst mod I've seen since 'Nam.
Website
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

Message box:

Code: Select all

MessageBox(handle, 'Message Text', 'Message Title', MB_Type or MB_Icon);
Valid options for MB_Type:

Code: Select all

 
  MB_OK
  MB_OKCANCEL
  MB_ABORTRETRYIGNORE
  MB_YESNOCANCEL
  MB_YESNO
  MB_RETRYCANCEL
Valid options for MB_Icon:

Code: Select all

  MB_ICONERROR
  MB_ICONQUESTION
  MB_ICONWARNING
  MB_ICONASTERISK
You don't need the "or MB_Icon" part but if you want you can use of those icons.

If:

If <Condition> Then
begin
//code here
end;

Example:

Code: Select all

If 1 = 1 Then
  begin
    MessageBox(handle, '1 = 1', '', MB_OK);
  end;
Declaring variables:

Put this outside of any 'begin'.

Code: Select all

var varName: Type;
Example:

Code: Select all

var x: Integer;

begin
    x := 1;
    If x = 1 Then
      begin
         MessageBox(handle, 'x = 1', '', MB_OK);
      end;
end;
Here's an example of putting it all together:

Code: Select all

var
  x: Integer;
  msg: PChar;
begin
  x:= 1;

  If x = 1 Then
    begin
      msg := 'x = 1';
      MessageBox(handle, msg, '', MB_OK);
    end;
end;
If this doesn't help then visit these links:
MessageBox:
http://delphi.about.com/od/windowsshell ... 02003b.htm

If
http://www.delphibasics.co.uk/RTL.asp?Name=If

Declaring variables
http://www.modelmakertools.com/articles ... l-var.html
Image
Jdogg





Posts: 184
Joined: Thu Aug 31, 2006 3:18 pm

Post by Jdogg »

thanks 8)
Post Reply