Casio Naurtech CETerm Ver.5.5 Scripting Guide Manual do Utilizador Página 110

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 164
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 109
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 110
{
// Resume online inventory, and save cached
// data to file in background.
CETerm.SetTimeout( "BackgroundSave(" + session + ");", 10 );
}
}
/* BackgroundSave */
function BackgroundSave( session )
{
var d = new ActiveXObject( "Microsoft.XMLDOM" );
d.loadXML(
"<?xml version=\"1.0\"?><Books>" +
"<Book QTY=\"10\"><Title>Beginning XML</Title></Book>" +
"<Book QTY=\"2\"><Title>Mastering XML</Title></Book>" +
"</Books>");
if (!OS.File.Write( "\\FlashDisk\\inventory.xml", d.xml ))
{
OS.Alert( "Failed to save inventory." );
}
}
5.6 ACCESSING A FILE
The File automation object provides basic access to the Windows CE filesystem.
It supports whole-file read and write, but does not support the concept of an
“open” file with piecewise read or write. You can also create and delete file
directories.
This example shows how to append to an existing file by using a combination of
read and write. The new File.Append() method should now be used to append
data to files but this example still illustrate how to use the File object.
/* AppendToFile */
function AppendToFile( filename, addedContent )
{
var status = false;
var F = OS.File;
// Check if file exists
var attributes = F.GetAttributes( filename );
if (attributes != 0xFFFFFFFF)
{
var content = F.Read( filename );
status = F.Write( filename, content + addedContent );
}
else
Vista de página 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 163 164

Comentários a estes Manuais

Sem comentários