Discussion

Left ArrowBack to discussions page
klacourtklacourt Posts: 12 Apprentice
I need pass a string value to a custom function.  Is there any way to declare a type for custom function parameters??

Best Answer

Comments

  • klacourtklacourt Posts: 12 Apprentice
    So since global b is already a string type before the function is called, the a variable takes on the type of the global b?

    What I have is a communication function that talks to a device, and it needs the IP address and port to grab the data.  The IP address is a string, the port is an integer.  So somewhere in the program, set a global ip variable as a string?

    def myCommFunc(ip,port):
    # connect to device, grab data

    return data
    end
  • klacourtklacourt Posts: 12 Apprentice
    Not sure what I did wrong, but started over and it works.  Thanks for the explanation!
  • matthewd92matthewd92 Posts: 995Founding Pro, Tactile Sensor Beta Testers Handy
    You’re welcome. 
Sign In or Register to comment.
Left ArrowBack to discussions page