| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ASCIIFileClass > AsciiFileClass Methods >====== SetPercentile (set file to relative position) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[setline a virtual to position the file .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[validateline a virtual to implement a filter .htm|{{btn_next_n.gif|Next page}}]] | | || **SetPercentile( **//percentile //**)** {{blk2blue.jpg|blk2blue.jpg}} | **SetPercentile** | Positions the file to the record nearest to: | | | File size * //percentile// / 100. | | //percentile// | A value between 0 and 100 that indicates a relative position within the file. This value may be set by a vertical scrollbar thumb position. | The **SetPercentile **method positions the file to the record nearest to file size * //percentile// / 100. You may use SetPercentile to position the file based on the end user's vertical scrollbar thumb setting. **Implementation:** The SetPercentile method positions the file based on a given percentage (usually determined by the vertical thumb position). SetPercentile extends the index as required and calls the virtual SetLine method to postion the file. SetPercentile calculates the position by dividing //percentile //by 100 then multiplying the resulting percentage times the file size. **Example:** **MyViewerClass.TakeDrag PROCEDURE(UNSIGNED EventNo)** ** CODE** ** IF FIELD()=SELF.ListBox** **  IF EventNo = EVENT:ScrollDrag** **  SELF.SetPercentile(SELF.ListBox{PROP:VScrollPos})  !reposition based on thumb** **  END** ** END** **See Also:     **[[setline a virtual to position the file .htm|SetLine]]