i got stuck!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • visuaalbaasic
    New Member
    • Nov 2006
    • 6

    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
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by visuaalbaasic
    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.
    Code:
    Public Function MyFunction(Parm1 As Long, Parm2 As Long, Parms3 As Long) As Single
    
      ' Do your calculation here, based on the values of
      ' Parm1, Parm2 and Parm3.
    
      ' Return your value by assigning it to the
      ' variable name "MyFunction".
      ' For example...
      MyFunction = Parm1 * Parm2 / Parm3
    
    End Function
    You can then use this anywhere in your code, like so...
    Code:
    Var1 = MyFunction(Var2, Var3, Var4)

    Comment

    • visuaalbaasic
      New Member
      • Nov 2006
      • 6

      #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 ?

      Comment

      • schandraram
        New Member
        • Sep 2006
        • 5

        #4
        Originally posted by visuaalbaasic
        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

        Comment

        • sivadhas2006
          New Member
          • Nov 2006
          • 142

          #5
          Hi,

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

          Regards,
          M.Sivadhas.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by sivadhas2006
            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?

            Comment

            • visuaalbaasic
              New Member
              • Nov 2006
              • 6

              #7
              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 :)

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by visuaalbaasic
                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.

                Comment

                Working...