SET CLASSLIB TO REGISTRY.VCX ADDITIVE oReg = CREATEOBJECT('Registry') RELEASE CLASSLIB REGISTRY lnvalue = 0 lcentry = "ResWidth" lcpath = "Software\Microsoft\VisualFoxPro\6.0\Options" IF oReg.GetKeyValue(lcentry, @lnvalue, lcpath, HKEY_CURRENT_USER) = 0 ? lnvalue ELSE * Error ENDIFNote the ampersand. That passes the variable by reference.