468,293 Members | 1,874 Online

# i got stuck!

hello ..
how can I determine the type of triangle through its sides and angles ?
i have problems in understanding how functions are being created and used ;/
plz help me
Nov 14 '06 #1
7 991
Killer42
8,434 Expert 8TB
hello ..
how can I determine the type of triangle through its sides and angles ?
i have problems in understanding how functions are being created and used ;/
plz help me
Well, once you create a function using the PUBLIC FUNCTION or PRIVATE FUNCTION statement, you can then use it just like the built-in functions (such as Mid\$() and so on).

Say you want to pass the lengths of three sides as integers and return a decimal value calculated somehow. You'd probably define your function in a code module. Here's a simple example.
Expand|Select|Wrap|Line Numbers
1. Public Function MyFunction(Parm1 As Long, Parm2 As Long, Parms3 As Long) As Single
2.
3.   ' Do your calculation here, based on the values of
4.   ' Parm1, Parm2 and Parm3.
5.
6.   ' Return your value by assigning it to the
7.   ' variable name "MyFunction".
8.   ' For example...
9.   MyFunction = Parm1 * Parm2 / Parm3
10.
11. End Function
12.
You can then use this anywhere in your code, like so...
Expand|Select|Wrap|Line Numbers
1. Var1 = MyFunction(Var2, Var3, Var4)
Nov 14 '06 #2
thank you:)
I have a problem,

In the 1st txtbox when i enter a value, and then press enter the value will be cleared and cursor is moved to the other box, and this doesn't happen in other txtboxes..
what might be the reasons behind that ?
Nov 16 '06 #3
thank you:)
I have a problem,

In the 1st txtbox when i enter a value, and then press enter the value will be cleared and cursor is moved to the other box, and this doesn't happen in other txtboxes..
what might be the reasons behind that ?
How does the cursor move to the other box when you press Enter? This is not the default behaviour in Windows applications, so maybe you have coded something in one of the events of the first text box?

Chandra
Nov 17 '06 #4
142 100+
Hi,

It may be useful for finding the problem.

Regards,
Nov 17 '06 #5
Killer42
8,434 Expert 8TB
Hi,
It may be useful for finding the problem.
Regards,
It might also be helpful if you fill in some more detail on the environment. For example, is this Visual Basic (standalone) - if so, which version? Is it VBA? In Access? Excel? Word?
Nov 17 '06 #6
thanks for trying to help me.. :)
for my good luck my problem was fixed .. till now i dont know how I did it, something related to the event itself, maybe,,
well, I'm using vb.net 2005

I have another question,
I created a msgbox, but when i start debugging the program,,,
at a certain event the msgbox appears, then i click on the OK button in it to let it disappear , but still it doesn't , As if it was freezed!
so I removed it from my program.

thank u :)
Nov 17 '06 #7
Killer42
8,434 Expert 8TB
thanks for trying to help me.. :)
...
We're always happy to help.

However, I'm a VB6 programmer and not familiar with VB 2005. Others here may be able to help more with the message box problem. You could also try the .Net forum, to see whether they can help.
Nov 19 '06 #8