
30
Programming Concepts
Example:
reader.onCommand = function(type, data)
{
// intercept | command with app-data: prefix
if( type == '|' && data.match(/^app-data\:/) )
{
return false; // Suppress the command
}
return true;
}
For more information on host communications, refer to the Interface Configuration
Document.
3.7
Data in Handheld Local Storage
The application development environment provides program access to handheld local
storage through the
storage
object (section 4.3.2.18). Data is maintained in storage as
named objects called files. Vision Configurator can transfer host data into a handheld
reader file. The handheld application can also store data in files.
The name of a handheld file may be 1 - 200 printable ASCII characters.
Use the
erase
and
write
methods of the
storage
object to manage files. Use the
findFirst
and
findNext
methods to locate files. Use the
read
method to access a file
or the
upload
method to send it to the host.
3.8
Demo Programs
Many of the concepts discussed in this section can be found in the source code of the
demo programs.