Solved

procedures

Posted on 1997-10-13
2
221 Views
Last Modified: 2010-04-16
How do I write a procedure (or function) that can take one or more variables of any data type? (For example, the WriteLn procedure can take any data type)? The WriteLn procedure can also take a unpredecided number of variables. How do I do that?
0
Comment
Question by:batgirl101397
2 Comments
 
LVL 2

Accepted Solution

by:
kellyjj earned 100 total points
ID: 1216194
The way you would do something like that is this:

procedure myown(var1,var2)
begin
end;

In pascal (at least TP) you can pass untyped variables to procedures. However, it is up to you to make sure you write your code in such a way that it will handle most anything you  will pass it without crashing.  Now you might want to check the exact syntax on the above.  I have only done this a couple of times and that was a while ago.
I hope this helps.
Out of curosity, why would you want to pass it some thing untyped??  write me let me know kellyj@r2d2.bpginc.com
0
 

Author Comment

by:batgirl101397
ID: 1216195
Oki. Can you explain how to make an untyped variable? And that still doesn't explain how to send a free number of variables to the procedure.
                                           /Lars, Sweden
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
help with delphi code 6 478
Capture cookies with delphi 5 991
Android Application not running 1 485
Using idhttp to login to instagram 2 65
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Moving applications to the cloud or switching services to cloud-based ones, is a stressful job.  Here's how you can make it easier.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now