RESET()

From Liberty BASIC Family
Jump to navigation Jump to search
Not supported in Just BASIC Not supported in Liberty BASIC Not supported in Liberty BASIC 5 Supported in Run BASIC

Description

Reset the row pointer for the result of the FILES command to the beginning of the list

Syntax

  1. #handle Reset()

Hints

This allows cycling through the result list again from the beginning

Example

List folders before files:

files #dir, DefaultDir$

dim f$(#dir rowcount())

numFiles = 0

  while #dir hasAnswer()
    #dir nextFile$()

    if #dir isdir() then
      numFiles = numFiles + 1

      f$(numFiles) = "["; #dir name$(); "]"
    end if
  wend

  #dir reset()

  while #dir hasAnswer()
    #dir nextFile$()

    if not(#dir isdir()) then
      numFiles = numFiles + 1

      f$(numFiles) = #dir name$()
    end if
  wend

for i = 1 to numFiles
  print using("###", i); " - "; f$(i)
next

end

Useful Procedures

' Place a useful function or sub using this keyword here