Need help for VBA syntax RRS feed

  • Question

  • Hello 

    I want to use a function and I can't get it to work. here's my code

    AxisName is the variable that return the value

        Dim AxisName(3) As ODBAXISNAME
        ret = cnc_rdaxisname(h, 4, AxisName(0))       'the function
        Debug.Print AxisName(0).sName       'give the good  result

        Debug.Print AxisName(1).sName       'give nothing

        Debug.Print AxisName(2).sName       'give nothing

        Debug.Print AxisName(3).sName       'give nothing

    There are 4 axis and I just get one

    If I just put AxisName instead of AxisName(0) in function it return an error

    Monday, February 15, 2016 4:52 PM

All replies

  • You only pass AxisName(0) to the function so there is no way for index 1, 2 and 3 to contain values?   Maybe you need to call it 4 times with different indexes.  Hard to tell since you don't provide any info on function.
    Monday, February 15, 2016 10:57 PM