468,293 Members | 1,874 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,293 developers. It's quick & easy.

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
thanks alot in advance
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
thanks alot in advance
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
sivadhas2006
142 100+
Hi,

Can you paste your code?
It may be useful for finding the problem.

Regards,
M.Sivadhas.
Nov 17 '06 #5
Killer42
8,434 Expert 8TB
Hi,
Can you paste your code?
It may be useful for finding the problem.
Regards,
Sivadhas.
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

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Astronomically Confused | last post: by
4 posts views Thread by =?Utf-8?B?TWF1cg==?= | last post: by
reply views Thread by =?Utf-8?B?QmlsbEI=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.