To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 4661
4660  |  4662
Subject: 
Re: Delphi support, anyone...?
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 14 May 2000 19:59:32 GMT
Viewed: 
704 times
  
Tore Eriksson skrev i meddelandet <391EAF34.6F42FEE4@mbox325.swipnet.se>...

Is there anyone here who knows Delphi and would like to answer
my beginner's questions if (read: when) I get stuck again? I
have some ideas that the LDraw Community may benefit from...

At last!

Feel free to write me directly (you have the address), and I'll answer what I
can. I program with Delphi both for a living, and for fun, and have been using
it since Delphi 1.0.

Oh, I already have one question:
Is it possible to make an array of objects, like for example
TButtons? I may want to do this:
For iBtn := 1 to nBtn do
begin
Button[iBtn].Visible := False;
end;

Your VB heritage is showing :-) Yes, you can do things similar to, but not
quite like, VB, but in the long run, you'll get more mileage out of the system
by forgetting the good ol' VB ways. Delphi is Delphi.

The above could be solved with the 'Components' array that belongs to the
form. Loop through all components on the form, and do something with those
that are TButton (or you might want to set a specific value in the Tag field).

  for i := 0 to Pred(ComponentCount) do begin
    if (Components[i] is TButton) then
      (Components[i] as TButton).Visible := False
  end;

You could also set up an array of references to the actual buttons, and use
that exactly like in VB. Just some extra code in the Form1.OnCreate() method.

The above is FTTOMH, so the compiler might have something to say about it, but
you get the idea.

Recommended reading:
Marco Cantu (sp?) has a primer on the Object Pascal language on his home
page(s). I don't have the URL here at home, but I can find it if you don't do
it yourself.

The Object Pascal Manual that comes with the product (mail or phone me, I
think I can dig up a spare one - at least for Delphi 1.0 :-)

Newsgroups:
borland.public.delphi.xxx  (make sure you get it directly off the Borland
server)
comp.lang.pascal.delphi.xxx

--
Anders Isaksson, Sweden
BlockCAD:  http://user.tninet.se/~hbh828t/proglego.htm
Gallery:   http://user.tninet.se/~hbh828t/gallery.htm



Message is in Reply To:
  Delphi support, anyone...?
 
Yesterday I sat all day long trying to create a very simple procedure with Borland Delphi 4 Standard version. In vain. Today I went to work to look up a PC magazine where I knew the answer is and found at once. Of course, it was very simple: in my (...) (24 years ago, 14-May-00, to lugnet.cad.dev)

5 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR