461
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
You will need to physically go to your device and upload correct firmware through
its serial port.
.Cutfromtop Method
Function:
Removes a specified number of sectors from the
beginning of a file opened "on" a currently selected file
number (selection is made through the
).
Syntax:
fd.cutfromtop(numsectors as dword) as
pl_fd_status_codes
Returns:
One of the following
, also affects
:
0- PL_FD_STATUS_OK: Completed successfully.
1- PL_FD_STATUS_FAIL : Physical flash memory failure
(fatal).
2- PL_FD_STATUS_CHECKSUM_ERR: Checksum error has
been detected in one of the disk sectors (fatal).
3- PL_FD_STATUS_FORMAT_ERR: Disk formatting error
has been detected (fatal).
8- PL_FD_STATUS_NOT_READY: The disk is not mounted.
See Also:
Part
Description
num
secto
rs
Number of sectors to remove from the beginning of the file. Supplied
value will be corrected if exceeded total number of sectors allocated to
this file.
Details
While the
allows to remove data from the end of the file, the
fd.cutfromtop allows to remove data from the beginning of the file. Removed data
sectors previously allocated to this file will be "released" (marked unused) as they
become unnecessary. The file, however, will always have at least one data sector
allocated to it. That is, if the file occupied three sectors, and you do
fd.cutfromtop(3), then one data sector will still remain in this file.
) will be corrected downwards in accordance
with the amount of removed data. For example, performing fd.cutfromtop(2) on a
file occupying 3 data sectors will reduce its size by 512 bytes (amount of data in 2
sectors removed). Performing fd.cutfromtop(3) will set the file size to 0.
) is always reset as a result of this method
execution. If the new file size is 0, then the pointer will be set to 0 as well. If the
file is not empty, then the pointer will be set to 1.
All possible status codes returned by this method are "generic" and are not
described here.
463
472
472
445
481
464
476