PDA

View Full Version : Determine if code is running in Layout vs Modeler?



sami
12-12-2012, 09:24 AM
At the risk of flooding this room with more of my unanswered questions, :rolleyes: can anyone tell me how to determine programmatically if a given code block is running inside Modeler or Layout? I have a library include for both a Modeler & Layout script, and I'd like to reuse it - but one task in that library has to be done differently depending on which app the script is running in. And of course I can just duplicate the code. But surely there is a define or something that tells me in LScript if I'm running a Layout generic vs a Modeler main?

thanks! :)

sami
12-16-2012, 06:15 AM
Found the answer finally... Overlooked it in the docs. Guess my search fu is not good when I've been coding late. Here it is in case anyone is interested:


runningUnder
The runningUnder function returns one of the following LAYOUT, MODELER, or SCREAMERNET).



app = runningUnder();