Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi Programming question

Posted on 1997-09-02
1
Medium Priority
?
165 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 40 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

618 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