what's the difference here?

Home Forums General Programming what's the difference here?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #83091
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      kitcolour=L(panel:getComponent("keydata"..i-1):getPropertyString("uiButtonTextColourOff"))
      or
      kitcolour=panel:getModulatorByName("keydata"..i-1):getComponent():getProperty("uiButtonTextColourOff")

      i think on the 2nd one, i could skip to getComponent() directly. but i’m not sure about
      L( ) macros – are they mainly for strings?
      both of these are working. i just ended up with them in two separate methods.
      (am in total spaghetti-land atm lol)

      #83092
      Possemo
      Participant
        • Topics: 14
        • Replies: 638
        • Total: 652
        • ★★★

        L() prepares a string for Lua string manipulations (that’s why it is called “L”). In some cases when you get a string from a component it won’t work without L() sometimes it does. I guess it depends what you want to do with the string. Commands like e.g. string.gmatch probably need a “converted” string by L().

        #83094
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          thanks, i think i’d figured out it was just for strings,
          as i was unable to – i think – do it with a regular ‘property’.

          oh… what’s string.gmatch? haven’t seen that one.

          #83154
          human fly
          Participant
            • Topics: 124
            • Replies: 1070
            • Total: 1194
            • ★★★★

            for info, it does of course also work going straight to
            the component, as:
            kitcolour=panel:getComponent("keydata"..i-1):getProperty("uiButtonTextColourOff")
            (just checked)

          Viewing 4 posts - 1 through 4 (of 4 total)
          • The forum ‘Programming’ is closed to new topics and replies.
          There is currently 0 users and 66 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