English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-08-23 06:00:52 · 5 answers · asked by Shelza K 2 in Computers & Internet Programming & Design

i m unable to understand the step of val

2006-08-23 06:06:35 · update #1

5 answers

create text1&2 ,label and commandbutton named text1,text2,label1,command1 respectively then write these codes on the command1
dim x as integer
dim y as integer
val(text1.text)=x
val(text2.text)=y
label1.caption=(x+y)
//run the program and press the commandbutton

2006-08-30 18:39:29 · answer #1 · answered by Ardon Jr T 1 · 0 0

place two TEXT BOXES, one LABEL, and one COMMAND BUTTON on a FORM.

Call the TEXT BOXES "txtAddendOne" and "txtAddendTwo".

Call the LABEL "lblResult".

Call the COMMAND Button "cmdCalculate"

In the cmdCalculate_CLICK event procedure, put the following:
=====
Dim lngAddendOne as long
Dim lngAddendTwo as long
Dim lngResult as long
'if this is done right, the "as long" in each of the lines above should convert to "As Long" automatically - note the change in caps.
lngaddendone = val(txtaddendone.text)
lngaddendtwo = val(txtaddendtwo.text)
lngresult = lngaddendone+lngaddendtwo
lblresult.caption = lngresult
'if these are done right, they should change case to match the declarations above, and the names of the objects on the form.
End Sub (will be supplied for you)

2006-08-23 13:12:40 · answer #2 · answered by Richard H 7 · 0 0

dim x as an integer
dim y as an integer

x = (formula for getting a random number)
y = (the same as x)

dim z as an integer

z = x+y;

2006-08-23 13:04:14 · answer #3 · answered by Jon 5 · 0 0

Option Explicit
Dim num1 As Integer
Dim num2 As Integer

Private Sub Form_Load()
num1 = (InputBox("Enter the first number"))
num2 = (InputBox("Enter the second number"))
MsgBox (num1 + num2) & " is the sum"
End Sub

2006-08-23 13:05:53 · answer #4 · answered by Prancing Stallion 2 · 0 0

sorry i'm in testing

2006-08-30 13:16:31 · answer #5 · answered by sixer 2 · 0 0

fedest.com, questions and answers