my own function call mystery

Home Forums General Programming my own function call mystery

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #69810
    Peter_EP
    Participant
      • Topics: 5
      • Replies: 19
      • Total: 24

      I can’t understand why my own function calls fail:

      function myLookup( input )
      pp = input + 16
      return  pp
      end

      then in another method call from a modulator:

      value = myLookup( 21 )

      when called I get this error

      attempt to call method ‘myLookup’ (a nil value)

      why is myLookup a nil value??

      #69812
      goodweather
      Participant
        • Topics: 45
        • Replies: 550
        • Total: 595
        • ★★★

        Tried your function and it works fine…
        Using console(tostring(myLookup(13))) to check the result

        >>> console(tostring(myLookup(13)))
        29

        Do you get this in the console?
        Type the above at the bottom of the console window then press Enter
        Your function can be anywhere (I mean in any compiled method).

        #69813
        Peter_EP
        Participant
          • Topics: 5
          • Replies: 19
          • Total: 24

          Thanks for the confimation Mr Good, that does help me and would you believe it, the same code now works!!! I can only think I got in a boggle-eyes situation, couldn’t see for looking type thing.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 138 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr