Page 1 of 1

[Implemented] Variable command argument for any functio

Posted: Sun Apr 14, 2002 3:45 pm
by BackupUser
Restored from previous forum. Originally posted by VeKem.

Hi,

in the feature list of v 3.0 there is:
"Added: Variable command argument for any function"

Can somebody give an example? Means this perhaps:

Procedure MyProc(par1.l, par2.l)
;... code depending on parameters (!)
; how to access more parameters?
EndProcedure

MyProc(12, 15, 4, 6) 'call with more or less parameters than defined before?

Thanks for your answers and help!

Markus Vedder-Kemnitzer, Germany
Registered PureBasic-User

Posted: Sun Apr 14, 2002 7:17 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Hi,

in the feature list of v 3.0 there is:
"Added: Variable command argument for any function"

Can somebody give an example? Means this perhaps:

Procedure MyProc(par1.l, par2.l)
;... code depending on parameters (!)
; how to access more parameters?
EndProcedure

MyProc(12, 15, 4, 6) 'call with more or less parameters than defined before?

Thanks for your answers and help!

Markus Vedder-Kemnitzer, Germany
Registered PureBasic-User
I think Fred had the library functions in mind, i.e. that you could code libraries with functions that can take a variable amount of parameters. This is what i think, anyone who knows for sure how things are?

Posted: Mon Apr 15, 2002 2:00 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Yes, thats for the PureBasic Libraries.

Example:

Code: Select all

Command >>  StrF( Value.f [,NbDecimal] )
            how to use:
                   myvar.f = 2.20371
                   Result1$ = StrF( myvar )
                   Result2$ = StrF( myvar, 2 )
There are some commands that already use it,
like CopyMemoryString() and CompareMemoryString()
for example, but i think in the feature we´ll get
more commands with varARGs.

cya,
...Danilo

(registered PureBasic user)

Posted: Mon Apr 15, 2002 5:58 am
by BackupUser
Restored from previous forum. Originally posted by VeKem.

Thanks, to Pupil and Danilo!

Markus Vedder-Kemnitzer, Germany
Registered PureBasic-User