|
Contents | Previous | Next | Subchapters |
| Syntax |
update(file, directory)file, directory, function callback) |
| See Also | filediff |
The user cannot choose his option until O-Matrix is done executing
the thread of commands in which the call to update is a part.
When the user does make his choice, a new execution thread is started.
If the function callback is present,
the function call callback(replace) is make
after update finishes its operation.
The argument replace is true if the file
was replaced and false otherwise.
temp.oms in the current directory contains
clear
version = "new"
#
print "This is the", version, "version"
print "done"
In addition, the file temp.oms in the directory
c:\omwin\programs contains
clear
version = "old"
#
print "This is the", version, "version"
print "done"
If at the command line you enter
file = "temp.oms"
directory = "c:\omwin\programs"
update(file, directory)
O-Matrix will print
difference: temp.oms <> c:\omwin\programs\temp.oms
<version = "new"
>version = "old"
in the command window and then ask if you wish to replace the
old version with the new on.
(Note that text from the new version is preceded by <
and text from the old version is preceded by >.)
If you agree, the file temp.oms
in the directory c:\omwin\programs will be replaced.
In any event, a message telling if the file has been replaced
is printed in the command window.