Solved

Delphi Programming question

Posted on 1997-09-02
1
162 Views
Last Modified: 2010-05-18
Hello Delphiers.

OK, OK, I'm a newbe and probably this is the stupidest one you've seen;
But I want to convert my project to Delphi and get read of the
much hated VB ...(please help me)

I Was trying to convert the following VB code :


TYPE TMib
      Codice = String(4)
      Titolo = String(1)
      UC = Single;
END TYPE
...
PUBLIC Mib() = TMib
...
size = db.recordcount
redim mib(1 to size)
for count = 1 to size
      mib(count).Codice = db("codice")
      ....
Next count


The kindness of Bryan Valencia (Software Services - Making Windows Scream) helped me
see that if I needed resizable arrays of User Defined type I could use
TList, for TList is a resizeble arrray of objects.

NOW HERE START THE PROBLEM .......

I've tried the following code

unit G;

interface
uses
      classes;

type
      TMib = class(TObject)
                Codice : String[4];
                Titolo : String;
                Tipol  : String[1];
                Incr   : Integer;
                UltimoClose : Single;
end;

Type
      TMibList = class(TList)
end;

Var
      IsConnected, GiornataAperta : Boolean;
          Mib : TMibList;
          tmpMib : TMib;


.....

But every time I try to access the tmpMib or MIb variables I get stack overflows,
even after calling 'tmpMib.Create' (<- No error but the var is still nil )

      WHAT'S WRONG .....?

P.S. The documentation regarding the Object Pascal is (Edited by Computer101) !
      I, like may others, must write some quite complex programs,
      and all the books talk about are forms and ActiveX ....Thanks
      If anyoune can suggest a good book on the subject, it will be great

Great Thanks to anyone who'll read this, I know it has to be a stupid one !!!

      Mark Gesiot
      magesiot@tin.it
0
Comment
Question by:mgesiot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
flisakow earned 20 total points
ID: 1343347

The code to create objects is:
   tmpMib := TMib.Create;
   Mib := TMibList.Create;

by just calling the routine a variable was created, but you lost
the pointer to it.
 
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question