Page 1 of 1
GetGadgetValue(#gadget)
Posted: Thu Aug 14, 2003 3:31 pm
by LJ
I'm tired of getting everything in a string, then having to VAL to get it to a value variable. It would be nice if Purebasic could perform some of these redundant tasks to make the language even simpler. Such a feature would be the value equivalent of GetGadgetText(#gadget), GetGadgetValue(#gadget).
For example, instead of this:
Code: Select all
a$ = GetGadgetText(1)
b.b = Val(a$)
We could do this:
Posted: Thu Aug 14, 2003 3:38 pm
by Rings
could been done like this
or like this:
Code: Select all
Procedure.l GetGadgetValue(GadgetNR.l)
Procedurereturn val(GetGadgetText(GadgetNR.l))
EndProcedure
b.b=GetGadgetValue(1)
no need (also speed) in my opinion for a new internaly command
Interesting...
Posted: Fri Aug 15, 2003 2:53 am
by LJ
Thanks Rings. What's up with NR in
Code: Select all
Procedure.l GetGadgetValue(GadgetNR.l)
Procedurereturn val(GetGadgetText(GadgetNR.l))
EndProcedure
What does the GadgetNR stand for? Is this a pointer?
[/quote]
Posted: Fri Aug 15, 2003 3:04 am
by Kale
What does the GadgetNR stand for
Gadget Number!
Re: Interesting...
Posted: Fri Aug 15, 2003 8:51 am
by freedimension
LJ wrote:Thanks Rings. What's up with NR in
Code: Select all
Procedure.l GetGadgetValue(GadgetNR.l)
Procedurereturn val(GetGadgetText(GadgetNR.l))
EndProcedure
What does the GadgetNR stand for? Is this a pointer?
[/quote]
Simply look into the description for GetGadgetText().
As said beforehand, NR is the German Abbreviation for Nummer (Number).
Posted: Fri Aug 15, 2003 9:05 am
by LarsG
...and Norwegian for nummer...

I understand...
Posted: Fri Aug 15, 2003 2:47 pm
by LJ
I understand, GadgetNR.l can be anything, it's just a holding spot for the gadget # that is sent to the procedure. The capital NR momentarily fooled me into thinking this was some sort of undocumented command in PB.
Posted: Fri Aug 15, 2003 3:13 pm
by Karbon
What's funny is that in Kentucky, "nummer" is how we say "number"... Ahhh you have to love the hillbilly culture... You can come here speaking English fluently and still not be able to understand a word that is said anywhere

Posted: Fri Aug 15, 2003 6:06 pm
by Rings
Karbon wrote:What's funny is that in Kentucky, "nummer" is how we say "number"... Ahhh you have to love the hillbilly culture... You can come here speaking English fluently and still not be able to understand a word that is said anywhere

except me, when i'm drunken
