Dietmar,
Below is an old message that may help. I haven't tried it.
Regards,
James
From: "GNR" <gnr@hyderabadwater.gov.in>
Subject: Re: nSerialHd() to work with all drives
Date: Saturday, February 15, 2003 10:04 AM
nSerialID() works well on all drives, mapped and physical.
I have tested this with FiveWin 2.0D and it works perfectly on mapped drives also.
I am reproducing the test program below:
include "fivewin.ch"
////////////////////////
FUNCTION Main( cDrive )
LOCAL nSerial
local cHex
DEFAULT cDrive := "C:"
nSerial := nSerialHD(cDrive)
cHex := L2HEX(nSerial)
cHex := LEFT(cHex,4) + "-" +RIGHT(cHex,4)
MSGINFO(cHex)
RETURN (0)
/////////////////////////
STATIC FUNCTION L2HEX(nDeciNum)
LOCAL cHex := ""
IF nDeciNum < 0
nDeciNum += ( 16 * 256 * 256 * 256 * 256 )
ENDIF
DO WHILE LEN(cHex) < 8
cHex := N16H(nDeciNum % 16) + cHex
nDeciNum := INT(nDeciNum/16)
ENDDO
RETURN ( PADL(cHex,8,"0") )
////////////////////////////
STATIC FUNCTION N16H(N)
IF N < 10
RETURN STR(N,1)
ELSEIF N < 16
N -= 9
RETURN CHR(64+N)
ENDIF
// ERROR
RETURN "*"
//////////////////////////////
This program returns the same result as VOL dos command returns.
Also It gives the same result from any PC in the net work or sthe same PC
The builtin L2HEX function is not good.
I have replaced this function.
I have tested this with FW 2.0d. I do not know how other versions behave.