#Hulk Posted January 20, 2018 Share Posted January 20, 2018 (edited) 1- Error in line 76 , 77 at argument 1 ! local screenW, screenH = guiGetScreenSize() wnd2 = guiCreateWindow((screenW - 276) / 2, (screenH - 338) / 2, 276, 338, "Furniture System List", false) guiWindowSetSizable(wnd2, false) guiSetVisible(wnd2,false) gr1 = guiCreateGridList(9, 24, 257, 231, false, wnd2) guiGridListAddColumn(gr1, "ID", 0.5) guiGridListAddColumn(gr1, "Name", 0.5) getit = guiCreateButton(75, 265, 127, 28, "Get it", false, wnd2) cl2 = guiCreateButton(75, 300, 127, 28, "Close", false, wnd2) guiGridListSetSelectionMode(gr1,2) node = xmlLoadFile("objects.xml") for i = 0,2 do subnode = xmlFindSubNode(node,"model", i) id = xmlNodeGetAttribute(subnode,"id") name = xmlNodeGetAttribute(subnode, "name") row = guiGridListAddRow ( gr1 ) guiGridListSetItemText ( gr1, row, 1, tostring(id), false, false ) guiGridListSetItemText ( gr1, row, 2, tostring(name), false, false ) end 2- can i delete all furniture from homes ? i mean it's empty Edited January 20, 2018 by #Hulk Link to comment
#Hulk Posted January 20, 2018 Author Share Posted January 20, 2018 in line 15 , 16 no help ? Link to comment
arciCZ Posted January 20, 2018 Share Posted January 20, 2018 You have node = xmlLoadFile("objects.xml") buut you loading id and name from xml in variable subnode. Link to comment
#Hulk Posted January 20, 2018 Author Share Posted January 20, 2018 Yes , i need get model object and id from file objects and put it in grid list ! objects.xml the main file Link to comment
arciCZ Posted January 20, 2018 Share Posted January 20, 2018 (edited) Yes but you have opened xml file in variable NODE and then you getting value id and name from varible subnode but you doenst opening xml and you dont have variable subnode //EDIT: Sorry i now see you have variable subnode. Edited January 20, 2018 by arciCZ Link to comment
ALw7sH Posted January 20, 2018 Share Posted January 20, 2018 (edited) Use xmlFindChild instead of xmlFindSubNode Plus it will help if you post what your xml file look like Edited January 20, 2018 by ALw7sH Link to comment
#Hulk Posted January 20, 2018 Author Share Posted January 20, 2018 13 minutes ago, ALw7sH said: Use xmlFindChild instead of xmlFindSubNode Plus it will help if you post what your xml file look like it's not work Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now