home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
FSEEK.TXT
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
51 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME FSEEK .TXT ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
PowerBASIC keeps internal track of file positions so, when you use SEEK as
function you get back PB's information that may, or may not be DOS's idea of
where the pointers are. This is not important unless you are using any of
the file reading/writing functions that use the file's handle:
fReadBlock? fWriteBlock?
fReadBlockPtr? fWriteBlockPtr?
fReadB? fWriteB?
fReadI% fWriteI?
fReadW?? fWriteW?
fReadL& fWriteL?
fReadD??? fWriteD?
What happens is that DOS writes/reads the data, updates the file pointers
but because we have by-passed PowerBASIC it doesn't have the changes stored
in it's variables. Mostly all of this is a "tempest in a teacup" as the SEEK
function is a rare call indeed but you need to be aware of the situation.
fSEEK& returns DOS's pointer position at all times!
There are 2 other functions that go beyond the SEEK statement that are
available to you if you need them:
fSEEKend& ( Handle% ) same as SEEK #FileNo, LOF(FileNo%)
fSEEKrel& ( Handle%, Bytes% ) this function will move the pointer
forwards (Bytes% > 0 ) or
backwards (Bytes% < 0 ) through the
file.
Once again, these are rare calls but may come in handy sometime!