[simpits-tech] VB Code to strip digits apart

Ken Trager simpits-tech@simpits.org
Tue, 18 Feb 2003 13:55:15 -0800


Gene

When I get home tonite Iam going to try all three examples out. Iam thinking
Gene is the shortest and
just what I whated - I will be able to send each digit out by its self - Iam
going to work on all three and
see.

Thanks to all for showing an example!!!!

Ken Trager

> I still th8ink mine was the best.  It converts an integer (what you'd get
> from FSUIPC to a string that is "transmittable" to an external device.
> Ken!  Ruling! :)
>
> g.
>
>
> On Tue, 18 Feb 2003, Erwin Neyt wrote:
>
> > Aha, a four-liner :) Good work Jeroen.
> >
> > Anyone going for less!?
> >
> > Erwin.
> >
> > > -----Original Message-----
> > > From: Jeroen Huijben [mailto:jeroen_huijben@hotmail.com]
> > > Sent: dinsdag 18 februari 2003 10:26
> > > To: simpits-tech@simpits.org
> > > Subject: Re: [simpits-tech] VB Code to strip digits apart
> > >
> > >
> > > How about:
> > >
> > > Dim intDigit (9) as Integer
> > > Dim intNumber as Integer
> > > Dim intCount as Integer
> > >
> > > Sub funStripDigits
> > >
> > > intCount = 10
> > > intNumber = Val(txtTextbox)
> > >
> > > While intCount > 0
> > >   intCount = intCount - 1
> > >   intDigit (intCount) = intNumber \ (10^intCount)
> > >   intNumber = intNumber Mod (10^intCount)
> > > Whend
> > >
> > > End Sub
> > >
> > > \ tells you how many times A goes fully into B.
> > >   5 \ 2 would give 2.
> > > Mod tells you how much remains after you've taken A fully out
> > > of B as often
> > > as possible.
> > >   5 mod 2 would give 1.
> > >
> > > _________________________________________________________________
> > > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > > _______________________________________________
> > > Simpits-tech mailing list
> > > Simpits-tech@simpits.org
> > > http://www.simpits.org/mailman/listinfo/simpit> s-tech
> > > To
> > > unsubscribe, please see the instructions at the
> > > bottom of the above page.  Thanks!
> > >
> >
> > _______________________________________________
> > Simpits-tech mailing list
> > Simpits-tech@simpits.org
> > http://www.simpits.org/mailman/listinfo/simpits-tech
> > To unsubscribe, please see the instructions at the bottom of the above
page.  Thanks!
> >
>
> _______________________________________________
> Simpits-tech mailing list
> Simpits-tech@simpits.org
> http://www.simpits.org/mailman/listinfo/simpits-tech
> To unsubscribe, please see the instructions at the bottom of the above
page.  Thanks!