tgetData and value format

Started by Walls, January 03, 2022, 06:44:53 AM

Previous topic - Next topic

Walls

Good Morning,
I am working on a script to obtain Avg. Disk Sec/Read & Avg. Disk Sec/Write over an extended period using the tGetData function. Currently I am testing with returning a floating number.

When running the script below, a number of times I get a 0.00000000e+000 value returned. What is this?  Sometimes I get values like 0.01259164 or 6.44575821.   

What are your thoughts on how to handle the returned value? My understanding is the returned value is in seconds. I am not sure about that as well. I am hoping someone with experiance can weigh on on this as well.

Below is a sample script I threw together for clarity. Thanks for any information, they has always been a very supportive message board.

AddExtender("WWPRC44I.DLL",0,"WWPRC64I.DLL")

FlagIntRet=0
FlagFltRet=1

LogFile="C:\Log\Avg.DiskSec_Read.txt"

GoSub GetCurrentTime
LogFileHandle = FileOpen(LogFile, "Write")
   FileWrite(LogFileHandle,"Log Avg DiskSec/Read")
FileClose(LogFileHandle)



FixedDriveList = DiskScan(2)
FixedDriveCnt = ItemCount (FixedDrivelist,@TAB)
For FixedDriveIdx = 1 to FixedDriveCnt
    GoSub GetCurrentTime
    FixedDrive = ItemExtract(FixedDriveIdx, FixedDriveList, @TAB)
        FixedDrive=StrSub(FixedDrive, 1, 1)
       
        LogicalDiskAvgDiskSecRead = tGetData("\LogicalDisk(%FixedDrive%:)\Avg. Disk Sec/Read",FlagFltRet)

        LogFileHandle = FileOpen(LogFile, "APPEND")
           FileWrite(LogFileHandle, StrCat("%YYYY%-%MM%-%DD% %HH%:%MN%:%SS%, ","LogicalDisk %FixedDrive%, Avg DiskSec/Read: ", LogicalDiskAvgDiskSecRead," s"))
        FileClose(LogFileHandle)
 
Next


Exit
:GetCurrentTime
   YYYY= ItemExtract(1,TimeYmdHms(),":")
   MM=ItemExtract(2,TimeYmdHms(),":")
   DD=ItemExtract(3,TimeYmdHms(),":")
   hh=ItemExtract(4,TimeYmdHms(),":")
   mn=ItemExtract(5,TimeYmdHms(),":")
   ss=ItemExtract(6,TimeYmdHms(),":")

Return

td

"0.00000000e+000" is a floating-point number in scientific notation. You use it just like you would use any other floating-point number in WinBatch.

Have no idea why you think the returned values are not seconds.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Walls

Thanks for the clarification. I have worked with a floating point number.