GetGadgetValue(#gadget)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
LJ
Enthusiast
Enthusiast
Posts: 177
Joined: Wed Apr 30, 2003 4:00 pm

GetGadgetValue(#gadget)

Post 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:

Code: Select all

b.b = GetGadgetValue(1)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

could been done like this

Code: Select all

b.b= val(GetGadgetText(1)) 
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
SPAMINATOR NR.1
LJ
Enthusiast
Enthusiast
Posts: 177
Joined: Wed Apr 30, 2003 4:00 pm

Interesting...

Post 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]
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

What does the GadgetNR stand for
Gadget Number!
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Re: Interesting...

Post 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).
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

...and Norwegian for nummer... 8)

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
LJ
Enthusiast
Enthusiast
Posts: 177
Joined: Wed Apr 30, 2003 4:00 pm

I understand...

Post 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.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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 :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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 :)
SPAMINATOR NR.1
Locked