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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Independence...

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,312
US
OK, let me ask another question (perhaps no one knows what to tell me?)...data independence...how do I do it? I know Pascal is a strongly typed language and all, but I'm wondering if Borland left a way in Delphi to be able to work on data of any type...

Ideas?
 
If you want the VB thing that you can put characters in a variable and 5 minutes later doing calculations with the same variable... the answer is still no VB will run and give garbage, the Delphi compiler will block these nonsense if it is done programatically. During runtime it will tell you that it is not allowed.

Data Independence: you have a wealth of things in Delphi, don't read a Pascal book and think that is Delphi. Just like Basic isn't VB

Steven
 
You can use type: 'variant'

Code:
procedure TForm1.Button1Click(Sender: TObject);
var myvariable : variant;
begin
myvariable := 'borland delphi 7';
showmessage(myvariable);

myvariable := 1234;
showmessage(inttostr(myvariable * 2));
end;

Giovanni Caramia
 
Like write or read. I can pop a variable of any type in them and they work. That kind of data independence. I want data type dependent on user input and not programmer choice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top