Solved

functions...

Posted on 2001-08-12
1
177 Views
Last Modified: 2010-04-06
Hello,

I can get the programm to work using a long case Table1.FieldDefs[i].DataType of
ftstring : begin
fieldDef[I].FieldType : 'String';
end;
ftInteger : begin ....etc its long...
So how can i use a function using enumerated type to make it shorter? I'm having problem with the DataType with Tfield aand string. Its from a database which the user will select from a combo box and I want to show the datatype of the database.

I used this and the Error is in the GetDataType....
for i:=0 to Table1.FieldDefs.Count-1 do
begin
CombFieldName.Add(Table1.FieldDefs[i].Name + '('+
GetDataType(Table2.FieldDef[i].DataType) + '-' +
IntToStr(Table1.FieldDefs[i].Size + ')');
end;

any ideas of how to go abt. I tried using the DB unit but still can't solve it.
0
Comment
Question by:rhapsody7
1 Comment
 
LVL 44

Accepted Solution

by:
CrazyOne earned 10 total points
ID: 6378396
Why not just use Fields[i].Name, Fields[i].DataType, Fields[i].Size instead of FieldDefs. :>)


The Crazy One
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

774 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