|
-
Jun 19th, 2000, 05:29 AM
#1
Thread Starter
Hyperactive Member
I am new to VB and am trying to make a very simple program for school. I need some very basic things. I have a form with 3 text boxes, a command button, and a label. Text1, Text2, Text3, Label1, Command1.
1. int4 = (int1, int2, int3) / 100
I have started with:
Dim....
for each as an integer. I then <i>thought</i> I could type:
int1 = text1.text
I was wrong. Invalid outside procedure. What would I type there? Thanks.
If you think education is expensive, try ignorance.
-
Jun 19th, 2000, 05:34 AM
#2
Are you sure the character's in the TextBox's are numbers when you assigned them to int1?
-
Jun 19th, 2000, 05:38 AM
#3
Thread Starter
Hyperactive Member
It's as soon as I hit the play button to test the script it gives me the error.
If you think education is expensive, try ignorance.
-
Jun 19th, 2000, 05:43 AM
#4
Fanatic Member
Well if your wanting label1 to be equal to the equation when you click the button try this:
Code:
Private Sub Command1_Click()
Label1.Caption = (CInt(Text1.Text) + CInt(Text2.Text) + CInt(Text3.Text)) / 100
End Sub
If not, give some more information so I can help you better.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jun 19th, 2000, 05:45 AM
#5
Thread Starter
Hyperactive Member
That is exactly it, thanks
If you think education is expensive, try ignorance.
-
Jun 19th, 2000, 05:46 AM
#6
Fanatic Member
Your welcome. If you need anything else, just let me know.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jun 19th, 2000, 07:07 AM
#7
transcendental analytic
Invalid outside procedure occurs when you have snippets of code outside your procedures. Also Cint will round towards nearest whole and .5 up. Using INT will allow you to round down, in other words, remove the decimal parts
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 19th, 2000, 07:16 AM
#8
_______
'or'
Label1.Caption = (Val(Text1) + Val(Text2) + Val(Text3)) / 100
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|