Skip to main content
Known Participant
January 31, 2023
Answered

Undocumented lua limitations?

  • January 31, 2023
  • 2 replies
  • 706 views

Hi,

 

I am running into what seem to be undocumented limitations in Lightroom's Lua environment and I am wondering if I am simply missing something.  Maybe someone more experienced can chime in and confirm or refute:

 

1) "goto" seems to be unsupported. (I am trying to use it to emulate "continue" in for loops.  Both the "goto" statement itself as well as the ::label:: is flagged.)

 

2) math.mininteger seems to be nil.

 

Thanks!

  Martin

This topic has been closed for replies.
Correct answer johnrellis

"math.mininteger seems to be nil."

 

Use "- math.huge".

2 replies

johnrellis
johnrellisCorrect answer
Legend
February 1, 2023

"math.mininteger seems to be nil."

 

Use "- math.huge".

Known Participant
February 2, 2023

Thanks!

johnrellis
Legend
February 1, 2023

""goto" seems to be unsupported. (I am trying to use it to emulate "continue" in for loops.  Both the "goto" statement itself as well as the ::label:: is flagged.)"

 

"continue" was added to versions of Lua newer than the version used in LR.  When I really want "continue", I use this idiom:

for ... do while true do
    ...
    if ... then break end -- continue
    ...
    break end end

 (I always format code to show the logical structure, not the formal syntactic structure. In Lua especially, slavishly formatting according to the syntactic structure results in unreadable indentation.)

Known Participant
February 2, 2023

Neat.  I guess this loses the ability to break out of the (outer) loop, though, no?

johnrellis
Legend
February 2, 2023

Yup, you can get break or continue but not both.