© MCS Electronics, 1995-2007
Print "Second of Day of " ; Time$ ; " is " ; Lsecofday
'Example 2 with defined Clock - Bytes (Second / Minute / Hour) Bsec = 20 : Bmin = 1 : Bhour = 7
Lsecofday = Secofday(bsec)
Print "Second of Day of Sec=" ; Bsec ; " Min=" ; Bmin ; " Hour=" ; Bhour ; " (" ; Time(bsec) ; ") is " ; Lsecofday
'Example 3 with System Second
Lsyssec = 1234456789 Lsecofday = Secofday(lsyssec)
Print "Second of Day of System Second " ; Lsyssec ; "(" ; Time(lsyssec) ; ") is " ; Lsecofday
' Example 4 with Time - String Strtime = "04:58:37"
Lsecofday = Secofday(strtime)
Print "Second of Day of " ; Strtime ; " is " ; Lsecofday
SEEK
Action
Function: Returns the position of the next Byte to be read or written
Statement: Sets the position of the next Byte to be read or written
Syntax
Function: NextReadWrite = SEEK (#bFileNumber)
Statement: SEEk #bFileNumber, NewPos
Remarks
bFileNumber |
(Byte) Filenumber, which identifies an opened file |
NextReadWrit |
A Long Variable, which is assigned with the Position of the next Byte to |
e |
be read or written (1-based) |
NewPos |
A Long variable that holds the new position the file pointer must be set |
|
too. |
|
|
This function returns the position of the next Byte to be read or written. If an error occurs, 0 is returned. Check DOS-Error in variable gbDOSError.
The statement also returns an error in the gbDOSerror variable in the event that an error occurs.
You can for example not set the file position behinds the file size.
In VB the file is filled with 0 bytes when you set the file pointer behind the size of the file. For embedded systems this does not seem a good idea.
Seek and Loc seems to do the same function, but take care : the seek function willreturn the position of the next read/write, while the Loc function returns the position of the astl read/write. You may say that Seek = Loc+1.