[simpits-tech] Changing numbers in VB6.0

Gene Buckle simpits-tech@simpits.org
Mon, 17 Feb 2003 15:26:32 -0800 (PST)


> Here is the problem
>
> A/P VSI is displayed in four numbers   - - - like 1200
>
> question is how to break that number down into single digits
>
> Iam trying to sent out the data to display it but I need to send it out
> one digit at a time.
>
> This example when be
>
> First number - 1
> Second - 2
> Third - 0
> Fourth - 0
>
> Is there a way to do this in VB programing?
>

Hmm.  Here ya go:

to convert numeric to string and then parse it apart:

    tempstr = CStr(IntegerNumber)

    for x = 1 to 4
       outputstr = mid(tempstr, x, 1)
       ...send outstr...
    next x


There ya go.

FYI, if you want raw speed, use Delphi instead. :)

g.