Announcement

Collapse
No announcement yet.

Help with 'for' syntax

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mrdude
    replied
    OOps, just noticed the sticky had already pointed this out:



    Line should be:

    Code:
    for nIndex, sObjectName in pairs (tObjects) do

    Leave a comment:


  • mrdude
    started a topic Help with 'for' syntax

    Help with 'for' syntax

    I had an old program that worked fine in APMS7 - I opened it and converted it to work in APMS 8.5 but I get errors with this line that starts with 'for':

    Code:
    function ClearAllInputObjects()
    	-- get a listing of all objects on the page
    	tObjects = Page.EnumerateObjects();
    	
    	-- step through the returned table
    	for nIndex, sObjectName in tObjects do
    		-- get the type of the current object
    		nObjectType = Page.GetObjectType(sObjectName);
    		
    		-- check the type
    		if nObjectType == 7 then
    			-- input object, clear it
    			Input.SetText(sObjectName, "");
    		end
    	end
    end
    The error is in this line:

    for nIndex, sObjectName in tObjects do


    What's changed between LUA that worked in APMS7 but not in APMS8.5?

    Thanks
Working...
X
😀
🥰
🤢
😎
😡
👍
👎