Variable numbers of arguments

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Variable numbers of arguments

Vinians
Hi again!
I need to make a function like 'printf' which have a variable number of arguments how to do this in Gambas?

Function MyPrintf(sFormat as String, Args as Variant...) as String or something like this ;P

ps. I dont want to use Arrays but true variable parameters

Thanks in advance




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Variable numbers of arguments

Fabien Bodard
Le Mardi 11 Octobre 2005 15:29, vinians a écrit :

> Hi again!
> I need to make a function like 'printf' which have a variable number of
> arguments how to do this in Gambas?
>
> Function MyPrintf(sFormat as String, Args as Variant...) as String or
> something like this ;P
>
> ps. I dont want to use Arrays but true variable parameters
>
> Thanks in advance

it exist in gambas :)

subst(MyPatternString as String, Args as String,...)

Like :

PRINT Subst("Hello &1, i'm &2 year old", "dude", str(age))

http://64.128.110.55/help/lang/subst


You can do a function yourself... but dynamic argument exist only in gambas2
with the '...' statement and param class.

Fabien Bodard



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Variable numbers of arguments

Vinians
In reply to this post by Vinians
---------- Cabeçalho original -----------

De: [hidden email]
Para: [hidden email]
Cópia:
Data: Tue, 11 Oct 2005 22:47:20 +0200
Assunto: Re: [Gambas-user] Variable numbers of arguments

> Le Mardi 11 Octobre 2005 15:29, vinians a écrit :
> > Hi again!
> > I need to make a function like 'printf' which have a variable number of
> > arguments how to do this in Gambas?
> >
> > Function MyPrintf(sFormat as String, Args as Variant...) as String or
> > something like this ;P
> >
> > ps. I dont want to use Arrays but true variable parameters
> >
> > Thanks in advance
>
> it exist in gambas :)
>
> subst(MyPatternString as String, Args as String,...)
>
> Like :
>
> PRINT Subst("Hello &1, i'm &2 year old", "dude", str(age))
>
> http://64.128.110.55/help/lang/subst
>
>
> You can do a function yourself... but dynamic argument exist only in gambas2
> with the '...' statement and param class.
>
> Fabien Bodard
>
Thanks, very much!  When Gambas2 will be released?



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Variable numbers of arguments

Fabien Bodard
Le Mercredi 12 Octobre 2005 01:35, vinians a écrit :

> ---------- Cabeçalho original -----------
>
> De: [hidden email]
> Para: [hidden email]
> Cópia:
> Data: Tue, 11 Oct 2005 22:47:20 +0200
> Assunto: Re: [Gambas-user] Variable numbers of arguments
>
> > Le Mardi 11 Octobre 2005 15:29, vinians a écrit :
> > > Hi again!
> > > I need to make a function like 'printf' which have a variable number of
> > > arguments how to do this in Gambas?
> > >
> > > Function MyPrintf(sFormat as String, Args as Variant...) as String or
> > > something like this ;P
> > >
> > > ps. I dont want to use Arrays but true variable parameters
> > >
> > > Thanks in advance
> >
> > it exist in gambas :)
> >
> > subst(MyPatternString as String, Args as String,...)
> >
> > Like :
> >
> > PRINT Subst("Hello &1, i'm &2 year old", "dude", str(age))
> >
> > http://64.128.110.55/help/lang/subst
> >
> >
> > You can do a function yourself... but dynamic argument exist only in
> > gambas2 with the '...' statement and param class.
> >
> > Fabien Bodard
>
> Thanks, very much!  When Gambas2 will be released?

it exist in beta develloppement as Gambas 1.9.20 and the stable version ....
mabe in many month... year ? ... We have time :)

Fabien

>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Variable numbers of arguments

Vinians
In reply to this post by Vinians
---------- Cabeçalho original -----------

De: [hidden email]
Para: [hidden email]
Cópia:
Data: Wed, 12 Oct 2005 22:16:11 +0200
Assunto: Re: [Gambas-user] Variable numbers of arguments

> Le Mercredi 12 Octobre 2005 01:35, vinians a écrit :
> > ---------- Cabeçalho original -----------
> >
> > De: [hidden email]
> > Para: [hidden email]
> > Cópia:
> > Data: Tue, 11 Oct 2005 22:47:20 +0200
> > Assunto: Re: [Gambas-user] Variable numbers of arguments
> >
> > > Le Mardi 11 Octobre 2005 15:29, vinians a écrit :
> > > > Hi again!
> > > > I need to make a function like 'printf' which have a variable number of
> > > > arguments how to do this in Gambas?
> > > >
> > > > Function MyPrintf(sFormat as String, Args as Variant...) as String or
> > > > something like this ;P
> > > >
> > > > ps. I dont want to use Arrays but true variable parameters
> > > >
> > > > Thanks in advance
> > >
> > > it exist in gambas :)
> > >
> > > subst(MyPatternString as String, Args as String,...)
> > >
> > > Like :
> > >
> > > PRINT Subst("Hello &1, i'm &2 year old", "dude", str(age))
> > >
> > > http://64.128.110.55/help/lang/subst
> > >
> > >
> > > You can do a function yourself... but dynamic argument exist only in
> > > gambas2 with the '...' statement and param class.
> > >
> > > Fabien Bodard
> >
> > Thanks, very much!  When Gambas2 will be released?
>
> it exist in beta develloppement as Gambas 1.9.20 and the stable version ....
> mabe in many month... year ? ... We have time :)
>
> Fabien
Hi again!
Im using Gambas 1.9.20 can you show me  an example function?  (please)

Thanxs in advance




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...