[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

convert label caption text to decimal number

Sheldon

8/21/2010 3:04:00 AM

Hello -

I have a value in a label that I need to convert to a decimal number so I
can multiply it by a decimal (VB6 application) . I forgot how to do that.
Can someone please refresh my memory?

Any help will be appreciated!
--
Sheldon
4 Answers

Jason Keats

8/21/2010 4:47:00 AM

0

Sheldon wrote:
> Hello -
>
> I have a value in a label that I need to convert to a decimal number so I
> can multiply it by a decimal (VB6 application) . I forgot how to do that.
> Can someone please refresh my memory?
>
> Any help will be appreciated!


You probably want one of these:

Me.Label1.Caption = "1234567890.6789012345678901234567890"

Dim number1 As Variant

If IsNumeric(Me.Label1.Caption) Then
number1 = CDec(Me.Label1.Caption)
Else
number1 = 0
End If
Debug.Print "1. " & number1


Dim number2 As Double

number2 = CDbl(Val(Me.Label1.Caption))
Debug.Print "2. " & number2

Dee Earley

8/25/2010 4:54:00 PM

0

On 21/08/2010 05:47, Jason Keats wrote:
> Sheldon wrote:
>> Hello -
>>
>> I have a value in a label that I need to convert to a decimal number so I
>> can multiply it by a decimal (VB6 application) . I forgot how to do that.
>> Can someone please refresh my memory?
>>
>> Any help will be appreciated!
>
> You probably want one of these:

Note that it is much better practice not to store data on a UI element
and only convert it to display it in the label.
The source data should be stored in a variable of an appropriate type.

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

gtriley@yahoo.com

1/31/2011 12:36:00 PM

0

Try changing Z13 on the driver board.
Also make sure you do not have a lamp hot side that is shorted to
ground.
Sounds stupid but I have had this happen a number of times.
Not enought to blow the fuse but enought to screw up the CPU.

Regards
George Riley

seymour-shabow

1/31/2011 12:40:00 PM

0

Vegemite Nick wrote:
> On Jan 31, 9:49 pm, Tec-9 <pacmanfan1...@yahoo.com> wrote:
>> On Jan 31, 4:13 am, Vegemite Nick <pinn...@thistledown.com.au> wrote:
>>
>>> G'day guys, working on a Spirit which I have mostly going, ground mods
>>> are done. Had a dodgy sound board that needed cap c33 (the under-rated
>>> one) replaced, now all working. But at the end of a game, the last
>>> sound running continues (despite the game showing as over etc,
>>> resetting otherwise). Any idea what I'm missing that is not telling
>>> the sound board to quit?
>> Try flipping dipswitch #25 on the CPU board.
>> -Mark
>
> No change, same problem.

Double check the dip switch is working - had boards where these like to
go bad.

-scott CARGPB#29