Solved

procedures

Posted on 1997-10-13
2
226 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
[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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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