Read a specific line from a file: Difference between revisions
Content added Content deleted
Line 1,005: | Line 1,005: | ||
=={{header|FutureBasic}}== |
=={{header|FutureBasic}}== |
||
Uses FB's |
Uses FB's openpanel command that opens a dialog window and allows the user to select the file to read. |
||
<lang futurebasic> |
<lang futurebasic>window 1 |
||
include "ConsoleWindow" |
|||
long i = 1 |
|||
Str255 s, lineSeven |
|||
CFURLRef url |
|||
url = openpanel 1, @"Select text file" |
|||
if ( url ) |
|||
open "I", 2, |
open "I", 2, url |
||
while ( not eof(2) ) |
while ( not eof(2) ) |
||
line input #2, s |
line input #2, s |
||
if ( i == 7 ) |
|||
lineSeven = s |
|||
end if |
|||
i++ |
|||
wend |
wend |
||
close 2 |
close 2 |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end if |
end if |
||
HandleEvents</lang> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</lang> |
|||
Input text file: |
Input text file: |