Author Topic: tgetData and value format  (Read 649 times)


  • Newbie
  • *
  • Posts: 13
tgetData and value format
« on: January 03, 2022, 06:44:53 am »
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.

Code: [Select]



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

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"))

   YYYY= ItemExtract(1,TimeYmdHms(),":")



  • Tech Support
  • *****
  • Posts: 4293
    • WinBatch
Re: tgetData and value format
« Reply #1 on: January 03, 2022, 08:43:47 am »
"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


  • Newbie
  • *
  • Posts: 13
Re: tgetData and value format
« Reply #2 on: January 03, 2022, 01:12:52 pm »
Thanks for the clarification. I have worked with a floating point number.