.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Passing variables.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
SRSDS
597 Views, 4 Replies

Passing variables.

Can someone suggest what is wrong here?

Diameter is passed in as 12.7 but it is not acceptint it as a true statement.

 

    Function Volume(Diameter As Single)
        If Diameter = 12.7 Then
        end if
    End Function

 

4 REPLIES 4
Message 2 of 5
arcticad
in reply to: SRSDS

    Function Volume(ByVal Diameter As Single) As Boolean
        If Diameter = CSng(12.7) Then
            Return True
        Else
            Return False
        End If
    End Function

---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 3 of 5
SRSDS
in reply to: arcticad

Thanks again!!

Message 4 of 5
sbarlage
in reply to: SRSDS

I think this will do it too:

 

If Diameter = 12.7# Then end if

Message 5 of 5
_gile
in reply to: sbarlage

Hi,

 

Don't make VB more verbose than it is...

 

    Function Volume(ByVal Diameter As Single) As Boolean
        Return Diameter = 12.7F
    End Function

 But why using a Single rather than a Double ?



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost