GetPercentile (convert file position to percentage:ASCIIFileClass)

Top  Previous  Next

 

GetPercentile( line number )

GetPercentile

Returns the specified position in the file as a percentage.

line number

An integer constant, variable, EQUATE or expression that contains the offset or position to convert to a percentage.

The GetPercentile method returns the specified position in the file as an approximate percentage, which can be used to position a vertical scroll bar thumb.

Return Data Type:     USHORT

Example:

SetThumb ROUTINE

!current line is what % thru the file?

PctPos=MyASCIIFile.GetPercentile(MyASCIIFile.TopLine+CHOICE(?ASCIIBox)-1)

?ASCIIBox{PROP:VScrollPos}=PctPos       !set thumb to corresponding % position