declare integer NetGetDCName in netapi32 string, string, string@ lcserver = 0 lcdomain = 0 lcbuff = replicate(chr(0),255) if NetGetDCName(lcserver, lcdomain, @lcbuff) = 0 then * fills lcbuff with a character representation of a pointer value * use the DWORDtoNum function in CLSHeap to translate it for the new * VFP 7 function SYS(2600) set procedure to clsheap * The name of the PDC is stored in the result using UNICODE * so we need to apply the necessary reverse functions via * STRCONV() to get single byte strings lcretval = strconv(strconv(sys(2600,DWordtoNum(lcbuff),255),6),2) * The name of the PDC is NULL terminated so we need to truncate at the * first CHR(0) (now that we have eliminated the embedded CHR(0) for UNICODE) ? left(lcretval,at(chr(0),lcretval)-1) endifHTH.