PROTECTED FUNCTION EnumValue LPARAMETERS tnHKey, tcSubKey, tnIndex, tnType LOCAL lcSubKey, lcReturn, lnResult, lcDataBuffer * tnHKey is the HKEY_LOCAL_MACHINE constant * tcSubKey is Software\OLEforRetail\..... * tnIndex in this case is 0 * tnType is also 0 tnType=IIF(type("tnType")="N",tnType,0) lnRegHandle=0 *** Open the registry key lnResult=RegOpenKey(tnHKey,tcSubKey,@lnRegHandle) IF lnResult#ERROR_SUCCESS *** Not Found RETURN .NULL. ENDIF *** Need to define here specifically for Return Type *** for lpdData parameter or VFP will choke. *** Here it's STRING. DECLARE INTEGER RegEnumValue ; IN Win32API ; INTEGER nHKey,; INTEGER nIndex,; STRING @lpszValueName,; INTEGER @lpdwSize,; INTEGER dwReserved,; INTEGER @lpdwType,; STRING @lpbData,; INTEGER @lpcbData tcSubkey=SPACE(MAX_INI_BUFFERSIZE) tcValue=SPACE(MAX_INI_BUFFERSIZE) lnSize=MAX_INI_BUFFERSIZE lnValSize=MAX_INI_BUFFERSIZE lnReturn=RegEnumValue(lnRegHandle, tnIndex, @tcSubkey,@lnValSize, 0, @tnType, @tcValue, @lnSize) =RegCloseKey(lnRegHandle) IF lnResult#ERROR_SUCCESS *** Not Found RETURN .NULL. ENDIF <b>* the next four lines are the workaround</b> tcValue = Alltrim(ChrTran(tcValue , Chr(0), "")) tcSubKey = Alltrim(ChrTran(tcSubKey, Chr(0), "")) if !empty(tcValue) and empty(tcSubKey) tcSubKey = "(Default)" endif RETURN tcSubKey ENDFUNCThe value of tcValue is the actual value in the reg export snippet, SOEPSON1.POSPrinter, but the tcSubKey is blank. Anyone know of a better way? TIA.