*-- DECLARE DLL statements for reading/writing to system registry DECLARE Integer RegOpenKeyEx IN Win32API ; Integer nKey, String @cSubKey, Integer nReserved,; Integer nAccessMask, Integer @nResult DECLARE Integer RegQueryValueEx IN Win32API ; Integer nKey, String cValueName, Integer nReserved,; Integer @nType, String @cBuffer, Integer @nBufferSize DECLARE Integer RegCloseKey IN Win32API ; Integer nKey CLEAR STORE 0 TO lnReserved, lnResult, lnType IF NOT (UPPER(OS()) = "WINDOWS NT" OR UPPER(OS()) = "WINDOWS 4") *I'm lazy and don't feel like checking other OS's right now =MESSAGEBOX("Only Compatiable With Windows NT") CANCEL ELSE lcMyKey = "Software\The Commonwealth Group\" lcThisKey = lcMyKey + "Test Key 1" lcQueryLabel = "Val 1" lnError = RegOpenKeyEx(HKEY_CURRENT_USER, ; lcThisKey, lnReserved, KEY_QUERY_VALUE, @lnResult) IF lnError = ERROR_SUCCESS && This always works lcBuffer = SPACE(128) lnBufferSize = LEN(lcBuffer) * and this always works lnError = RegQueryValueEx(lnResult, lcQueryLabel , lnReserved, ; @lnType, @lcBuffer, @lnBufferSize) IF lnError = ERROR_SUCCESS lcValue = ALLT(LEFT(lcBuffer, lnBufferSize)) ENDIF lcBuffer = "New Value" lnBufferSize = LEN(lcBuffer)+10 DECLARE Integer RegSetValueEx IN Win32API ; Integer nKey, String @cValueName, Integer nReserved, ; Integer nType, String @cBuffer, Integer nBufferSize * This returns a 5, always, I've tried using the '@' in various * combinations but I get the same result. IF lnError = ERROR_SUCCESS lnError = RegSetValueEx(lnResult, lcQueryLabel, lnReserved, ; lnType, lcBuffer, lnBufferSize) ENDIF IF lnError = ERROR_SUCCESS lnError = RegQueryValueEx(lnResult, lcQueryLabel , lnReserved, ; @lnType, @lcBuffer, @lnBufferSize) IF lnError = ERROR_SUCCESS lcValue = ALLT(LEFT(lcBuffer, lnBufferSize)) ENDIF ELSE =Messagebox("NOPE") ENDIF ENDIF *-- Close the key =RegCloseKey(lnResult) ENDIF CLEAR DLLS CLEAR ALL RELEASE ALL EXTENDEDP.S. It's good to be back. I missed all of you.