Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SUB & FUNCTION parameters
#11
VB

Try those IFEXIST stuff.LOL
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#12
Quote:
wildcard Wrote:You can do that in perl. For QB, why don't you just use an array?
:???: What does an array have to do with anything?

Well theres two ways I would do it.

First, use an array. Say the maximum number of parameters you wanted was ten then I'd have paramarray(1 to 10) and go through the loop setting the appropriate slots to what I needed and the last to something they would never been.

Or alternatively I would use a user definted type. E.g. For a pixel ploting routine where you may want more than one pixel at a time?

TYPE Param
x1 as INTEGER
y1 as INTEGER
col1 as INTEGER
x2 as INTEGER
y2 as INTEGER
col 2 as INTEGER
END TYPE

Then I would set Param.x1/etc to what I wanted and if I wasn't using x2 I would set it to zero or minus some number I would never need.
Reply
#13
Gotcha, thanks.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#14
Quote:*do* it.


na_th_an Wrote:You can do something similar in C, where you can have functions with any number of parameters, which are processed doing SHIFTs just like with DOS batch file parameters (anyone remembers that Big Grin?)

Me too. I told that 'cause many people here are children under 18 who don't ever know what is a batch file.

As for windows, I prefer WSH. It is way more powerful.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#15
Er..na_th_an, using DOS was still popular in 1995. You wouldn't have to be 18 to know what a batch file was.
Plus, windows still uses batch. If it weren't for AUTOEXEC.BAT, my computer wouldn't load some vital drivers.

Heh, my bro taught me batch :bounce:
I just can never figure out why Microsoft used ERRORLEVEL in IF statements :???:
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)