User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 62
// Check if can read value
var readdata = R.ReadValue( fullyQualifiedKey );
if (readdata == valuedata)
{
status = true;
}
}
if (!status)
{
OS.Alert( "Failed to confirm write of " +
fullyQualifiedKey );
}
return status;
}
NewRegistryDWORD may be used as follows.
// Write a new value
NewRegistryDWORD( "SOFTWARE\\Naurtech\\Test", "TestDword", 510 );
5.8 WRITING EFFICIENT SCRIPTS
Good programming practices should be used when developing scripts for
CETerm. In general, it is important to conserve memory, minimize script
compilations, and limit execution times. Please refer to a JavaScript
programming book for more information.
5.8.1 Use Local Variables
Whenever possible, use local variables within functions and declare them with
the var keyword, like this:
var status;
var message = "hello";
var i, j, k;
If you fail to use the var keyword, then JavaScript automatically creates a global
variable with that name if it has not already been declared outside a function.
JavaScript uses “garbage collection” to reclaim memory no longer in use.
Memory occupied by global variables may never be reclaimed, whereas local
variable memory can be reclaimed after a function call completes. Because the