[Implemented] Variable command argument for any functio

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] Variable command argument for any functio

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by VeKem.

Thanks, to Pupil and Danilo!

Markus Vedder-Kemnitzer, Germany
Registered PureBasic-User
Post Reply