Currency String Gadget - now with Fanglized version

Share your advanced PureBasic knowledge/code with the community.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I don't like to steal other people's posts but...

@Fangles - grab my code at the end of ...

http://www.purebasic.fr/english/viewtop ... c&start=15

... this post.

In the example, change ...

Code: Select all

SetGadgetMask(0, "999-99-9999", "123456789", '*', #False)
... to ...

Code: Select all

SetGadgetMask(0, "$999999.99", "", '#', #False)
It can work for this purpose but fails if you want a variable amount of numbers before the decimal. However, I know how much you hate large pieces of code so I doubt you'll use it :)

I'll see if I can make an adjustment for currency values.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I don't like to steal other people's posts but
Come on in Xombie, the water's fine! More the merrier :D
BERESHEIT
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Xombie wrote:I don't like to steal other people's posts but...

@Fangles - grab my code at the end of ...

http://www.purebasic.fr/english/viewtop ... c&start=15

... this post.

In the example, change ...

Code: Select all

SetGadgetMask(0, "999-99-9999", "123456789", '*', #False)
... to ...

Code: Select all

SetGadgetMask(0, "$999999.99", "", '#', #False)
It can work for this purpose but fails if you want a variable amount of numbers before the decimal. However, I know how much you hate large pieces of code so I doubt you'll use it :)

I'll see if I can make an adjustment for currency values.
You are right, I doubt I'll use it as it was a silly comment on your part. :D :D :D 3 smileys for you :D :D :D :evil:
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

TerryHough wrote:
Fangbeast wrote:I want a properly formatted, masked string gadget
such as I used to use in early versions of visual basic. I used it back in
the early days of vb.
This isn't a gadget, but here is code I posted in May 2004 about
something similar (updated for PB 4.00). Sparkie was involved in that
topic too :D

Maybe you will find a useable idea here, before all the brain matter leaks
out the eye sockets.
[/code]
Terry you old bugger, still hiding around the forums I see!! Arr, good to see your stuff. Your date picker code got me started years ago and it's still damned useful.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Terry I have to cut all the sound out... I seem not to have those noises... Looks like good work otherwise!
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Xombie wrote:I don't like to steal other people's posts but...

@Fangles - grab my code at the end of ...

http://www.purebasic.fr/english/viewtop ... c&start=15

... this post.

In the example, change ...

Code: Select all

SetGadgetMask(0, "999-99-9999", "123456789", '*', #False)
... to ...

Code: Select all

SetGadgetMask(0, "$999999.99", "", '#', #False)
It can work for this purpose but fails if you want a variable amount of numbers before the decimal. However, I know how much you hate large pieces of code so I doubt you'll use it :)

I'll see if I can make an adjustment for currency values.
If you are still reading this post, try to adjust a few things first please, unless the code is generic to masks and not specific to currency (I think I made a silly comment myself there (grin))

1. Don't allow the cursor to go before the "$" symbol.
2. Make the field mask len char "#" invisible, it doesn't need to be seen I think. Not sure how excel does it as I haven't got it.
3. Check if the user pressed the "." and jump after the decimal point.

Should you choose not to accept this mission mr spock, the message will self destruct in 10 seconds.

Good work by the way.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Fangbeast wrote:
Should you choose not to accept this mission mr spock, the message will self destruct in 10 seconds.

Good work by the way.
Mr Phelps, I believe - only us old codgers remember that :)
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

rsts wrote:
Fangbeast wrote:
Should you choose not to accept this mission mr spock, the message will self destruct in 10 seconds.

Good work by the way.
Mr Phelps, I believe - only us old codgers remember that :)
I know it was phelps but spock sounded more modern. And xombie's ears need prunind:):)
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I'm pretty sure it was five seconds.
BERESHEIT
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

netmaestro wrote:I'm pretty sure it was five seconds.
I added the extra 5 because rsts said "us old codgers remember that" and us old codgers are slow and need the extra 5 seconds
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

[moved to first post]
Last edited by netmaestro on Fri Feb 16, 2007 7:02 am, edited 1 time in total.
BERESHEIT
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

You guys crack me up. But I'm still sending a bunch of feral, lobotimsed hamsters with laser gun scopes to take you out for those cracks!!

And listen here Netmaestro, you haven't passed the old geezer test yet so I'm not sure you are allowed to use my copyright name of "Fanglized", certified by the old geezers association.

Now Sparkie I can vouch for, he passed with flying colours (Evil Grin(c) 2007))
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I bet I'm older than you..

( I started coding with punchcards :wink: )
BERESHEIT
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

netmaestro wrote:I bet I'm older than you..

( I started coding with punchcards :wink: )
I was born at/before punchcards (I think). Doesn't change the fact that you have to pass the geezer test, send me some martian dollars, assorted loose women (And they have to be loose because the tight ones kill me) and 3 witnesses must sign.

Relatives, friends and pad off third parties may not sign!!!
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
stubbsi
User
User
Posts: 50
Joined: Tue Jul 04, 2006 8:59 pm
Location: Mt Martha, Australia

Post by stubbsi »

Ah -- I remember punch cards

Ah -- I remember tripping

Ah -- I remember :(
Vincit qui primum gerit
"The Old Farts Wins" or "He Conquers Who First Grows Old"
Post Reply