• 1 reply
  • Latest Post - ‏2018-05-18T12:45:35Z by davidcs
3 Posts

Pinned topic Print/Extract Object Text From Module - DXL Script in Explorer Menu

‏2018-05-16T17:53:06Z |

I am a newb to DXL -- and programming in general, so bear with me. I am trying to run a script from the explorer menu that will open a specific module and identify some object text. I have hunted through the threads and found a program that will run for a DXL script inside of a module and do what I ask by returning object text that is called out. It does not work when executed in the explorer window. It's my goal to end up running this in a loop so that it can scan all my modules for specific object text. I want to learn to walk before running though, so getting it to work from the explorer for one module is my goal right now. Any help on what commands I am missing, or what syntax error I am making? When I run this in the explorer DXL editor I get a:


"-R-E- DXL: <Line:10> null Object parameter was passed into argument position 1"

I assume this means that it can't identify the object. When I comment out below line 4 the program runs with no errors, so I know how I am calling the current module is correct. Is it because it is not in exclusive edit mode when it goes through the module looking for the object? Is my call out of the object formatted incorrectly? Any help is appreciated!

pragma runLim, 0

m1 = edit("/Project/Folder/NameOfModuleOneWord", false)
currentModule = m1

oCurrent = object 7

string Text = oCurrent."Object Text"

print"Object Current\"Object Text\" : " Text


  • davidcs
    41 Posts

    Re: Print/Extract Object Text From Module - DXL Script in Explorer Menu


    I would discourage the use of 'current' in most cases and just pass the module handle in as the optional second parameter in the object function. Assuming the module is opened successfully (nobody has it locked) and the object actually exists this should always succeed but you should be checking for these conditions as modules and objects aren't static and tend to move around or get deleted. This is the function I was referencing:

    Object object(int absno[,Module m])