Code: Select all
Type array
As String s(1 To 255)
As Long idx(1 To 255)
Declare const Function find(As Long) As const String
Declare Constructor()
End Type
Constructor array()
static as long n
if n=1 then print "Closed for business":return
n+=1
#define i "",
Dim As String g(1 To 255)= _
{ _
"Raw Read Error Rate", _ '1
"Throughput Performance", _ '2
"Spin Up Time", _ '3
"Start/Stop Count", _ '4
"Reallocated Sector Count", _ '5
"Read Channel Margin", _ '6
"Seek Error Rate", _ '7
"Seek Time Performance", _ '8
"Power-On Hours Count", _ '9
"Spin Retry Count", _ '10
"Drive Calibration Retry Count", _ '11
"Drive Power Cycle Count", _ '12
"Soft Read Error Rate", _ '13
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i _
"SATA Downshift Error Count", _ '183
"End to End Error Det/Corr Count", _ '184
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i i i i i i i i i i _
i i i i i i i i i i _
"Free Fall Sensor", _ '254
"" _
}
#undef i
For n As Long=1 To 255
this.s(n)=g(n)
this.idx(n)=n
Next n
Erase g
End Constructor
function array.find(n as long) as const string
return this.s(n)
end function
Dim As array Temp
Dim As Const array C=Temp
print C.find(3)
dim as array A
Sleep