Re: File I/O ?


[ Follow Ups ] [ BasicCard User Forum ]

Posted by zeitcontrol (145.254.161.91) on March 13, 2003 at 06:47:11:

In Reply to: File I/O ? posted by ravindra on March 12, 2003 at 04:44:56:

Hello ravindra,

the DOS like file system is still supported. It is available in all Enhanced and Professional BasicCards. There is a second example about this which is the Enhance BasicCard example (c:\basiccardpro\examples\enhance).

Still often the file system is not the best choice. Often it is more simple to use EEPROM variables instead. EEPROM variables are also permanent and such do not loose their content when card is pulled out of the reader. Compared to data in files it is much more simple to access EEPROM variables from within your BASIC code. E.g. you may be able to fulfill your requirements above like this:


--------------------
EEPROM CardUserName as String
EEPROM CardEmployeeID as String
EEPROM CardEntryDate as Long

Command &HD0 &H00 SetUserName(UserName as String)
CardUserName=UserName
End Command

Command &HD0 &H02 GetUserName(UserName as String)
UserName=CardUserName
End Command

Command &HD0 &H04 SetEmployeeID(ID as String)
CardEmployeeID=ID
End Command

Command &HD0 &H06 GetEmployeeID(ID as String)
ID=CardEmployeeID
End Command

Command &HD0 &H08 SetEntryDate(Date as Long)
CardEntryDate=Date
End Command

Command &HD0 &H0A GetEntryDate(Date as Long)
Date=CardEntryDate
End Command
--------------------
Sample above does not include any security checks, which you may want to add.


Follow Ups:


[ Follow Ups ] [ BasicCard User Forum ]