(function() { file = "test.database" X = XApplication("Tabs") dpy = as(X,"XAppDisplay") db = XDatabase(dpy) # now add a new resource setResource(db,"*newcache: Test of SXLib's database mechanism") # write the resources out (with the new resource) # you should test that this value is at the bottom of the # output file. Dump.database(db,file) check = unix(paste("grep newcache",file)) cat("[grep]") print(check) db1 = XDatabase(file) val = getResource(db1,"*newcache") cat("[file]") print(val) setResource(db1,"*newcache: New Value for SXLib") val = getResource(db1,"*newcache") cat("[file]") print(val) val = getResource(db,"*newcache") cat("[display]") print(val) XMergeDatabases(db1,db) val = getResource(db,"*newcache") cat("[display]") print(val) # now check that we get the empty val = getResource(db,"*no-resource") cat("[display]") print(val) val = getResource(db,"*geometry") cat("[display]") print(val) # Now create a local database using resources db2 = XDatabase(XResource("*newValue","Internal Resource Database")) val = getResource(db2,"*newValue") cat("[internal]") print(val) XMergeDatabases(db,db2) val = getResource(db2,"*geometry") cat("[internal]") print(val) setResource(db2,"*addedResource: This is an added resource") val = getResource(db2,"*newValue") cat("[internal]") print(val) val = getResource(db2,"*addedResource") cat("[internal]") print(val) })()