Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

procedures

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
batgirl101397
Asked:
batgirl101397
1 Solution
 
kellyjjCommented:
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
 
batgirl101397Author Commented:
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now