Type conversion functions

Discussion in 'AutoCAD' started by Paul de Boer, Apr 23, 2004.

  1. Paul de Boer

    Paul de Boer Guest

    Hi all, is it common to use a Type Conversion Function when a value is already of the correct type, for example
    ' Dim iVal as integer '
    ' iVal = cInt(234) ' , and the same for arguments in a Function or Procedure, for example

    ' Private Function TakesOnlyIntegers ( iVal as Integer) as Integer '
    ' iVal = Ival * 100 '
    ' End Function '

    ' Dim iValue as Integer '
    ' iValue = 2 '

    ' TakesOnlyIntegers Cint(iValue) '

    Many thanks Paul
     
    Paul de Boer, Apr 23, 2004
    #1
  2. Paul de Boer

    Kevin Terry Guest

    No, that is not common. cInt would be used when you need to convert a Long
    to an Integer, or break the decimal portion of a Double off a number, that
    kind of thing.

    Kevin

    already of the correct type, for example
     
    Kevin Terry, Apr 23, 2004
    #2
  3. Paul de Boer

    Paul de Boer Guest

    Thanks Kevin
     
    Paul de Boer, Apr 23, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.