Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complex Arrays and Codeblocks

Status
Not open for further replies.

cjluke

Programmer
Jun 8, 2005
3
US
To all of you ex-Clipper Programmers. What do you do in Delphi / Pascal as a replacement for those wonderful dinamic complex arrays and the *all powerful* codeblocks that we had in Clipper.

Does anyone know of any attempt to get Delphi/Pascal to at least handle Complex arrays---I understand that the *strong typed* structure of Pascal does not lend itself well to the concept of *dynamic* complex arrays but that would be better yet :)

I switched from Clipper to Delphi back in the days of Win95, and still miss these two features.
cjluke
 
Untill TP 5.0, Pascal had strong typed structure (there were also pointers etc.)
TP 5.5 started with OOP (Object Oriented Programming)
Delphi has objects (classes) that are a different animals than traditional variables.
I am not an (ex) clipper programmer, so maybe I am missing something.

Steven
 
In Clipper we could create a dynamic multidimensional ... array that could have a complex structure of various data types *on the fly*. In Pascal you must name/declare an array with the structure and datatype predefined.

When I said strong typed...that is what I was refering to...the act of declaring/defining a variable in the declarations area before use.

A Codeblock was a very cool data type *so to speak*...it was a function or procedure that could be passed or returned in a procedure/function call. For Example: you are using a dbgrid to display the contents of a file and you pass a codeblock to one of the columns that causes that column to return a calculation of data that comes from program variables/linked data in another file/other columns in the same table....kind of thing.
cj
 
you are using a dbgrid to display the contents of a file and you pass a codeblock etc...

That is the basis of object-oriented programming. Until TP 5.0 you could say that the language promoted very strong typed programming. With TP 5.5 the idea of objects started. If you look at what you can do with Delphi in terms of data (no not the drop-down thing to make fancy mouse operated appearances), I see no differences with the "clipper codeblocks".

Steven
 
You may already know this anyway but I'll say it just in case you don't:
As for dynamic multidimensional complex arrays, you can use Record structures to create your complex data of various data types - and yes you do have to construct these at design-time in code. And to create an array of these records you would have to define it at design-time with something like:
Code:
  ComplexArray: Array of TComplexDataType;

At run-time, you could use SetLength to dimension the array as a multi-dimensional array and this is what I would label dynamic.

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top