SaveWatch command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
|width="50%"| '''Action:'''
|width="50%"| '''Action:'''
|width="50%"|
|width="50%"|
<span class="f_Para">Saves to a local file the list of items currently displayed in the </span><span class="f_GUIlabel">Watch Window</span><span class="f_Para">, as described in [[saving_restoring_watch_window.html|Saving and restoring Watch Window contents]]. </span>
<span class="f_Para">Saves to a local file the list of items currently displayed in the </span><var>Watch Window</var><span class="f_Para">, as described in [[Saving and restoring Watch Window contents|Saving and restoring Watch Window contents]]. </span>


<span class="f_Para">The command's first optional argument is the name of the </span><span class="f_Monospace">.watch</span><span class="f_Para"> file in which to store the </span><span class="f_GUIlabelTable">Watch Window</span><span class="f_Para"> contents: </span>
<span class="f_Para">The command's first optional argument is the name of the </span><span class="f_Monospace">.watch</span><span class="f_Para"> file in which to store the </span><var>Watch Window</var><span class="f_Para"> contents: </span>


<p class="syntax">saveWatch [''watchfile'' [overwrite]]</p>
<p class="syntax">saveWatch [''watchfile'' [overwrite]]</p>
Line 14: Line 14:
Otherwise, if you specify a ''watchfile'' argument (the .watch extension may be omitted), the Watch Window contents are stored in the named file when the command executes.  
Otherwise, if you specify a ''watchfile'' argument (the .watch extension may be omitted), the Watch Window contents are stored in the named file when the command executes.  


The Client saves the watch file in the folder that contains the JanusDebugger.exe file, [[change_location_client_work.html|by default.]]  
The Client saves the watch file in the folder that contains the JanusDebugger.exe file, [[Changing the location of Client work files|by default.]]  


<span class="f_Para">If a watch file with the same name already exists when </span><span class="f_Monospace">saveWatch</span><span class="f_Para"> executes, the result depends on whether you also specified the </span><span class="f_Monospace">overwrite</span><span class="f_Para"> parameter: </span>
<span class="f_Para">If a watch file with the same name already exists when </span><span class="term">saveWatch</span><span class="f_Para"> executes, the result depends on whether you also specified the </span><span class="f_Monospace">overwrite</span><span class="f_Para"> parameter: </span>


*If it is not specified, the saveWatch command fails, and an error message is issued.  
* If it is not specified, the saveWatch command fails, and an error message is issued.  
*If it is specified, the existing file gets overwritten.
* If it is specified, the existing file gets overwritten.


You may also specify the watch file name in these ways:  
You may also specify the watch file name in these ways:  


*As a [[working_with_macro_variables.html|macro variable]]. For example:
*As a [[Working with macro variables|macro variable]]. For example:


<p class="syntax">set &amp;a = &quot;foo&quot; </p>
<p class="syntax">set &amp;a = &quot;foo&quot;
<p class="syntax">saveWatch &amp;a overwrite </p>
saveWatch &amp;a overwrite </p>


*With an absolute file system path, which ''must be enclosed in quotation marks.''
* With an absolute file system path, which ''must be enclosed in quotation marks.''


<p class="syntax">saveWatch &quot;c:\temp\foo.watch&quot; </p>
<p class="syntax">saveWatch &quot;c:\temp\foo.watch&quot;
<p class="syntax">saveWatch &quot;c:\temp\foo.watch&quot; overwrite </p>
saveWatch &quot;c:\temp\foo.watch&quot; overwrite </p>


The [[LoadWatch command|loadWatch]] command restores the Watch Window contents from a watch file.  
The [[LoadWatch command|loadWatch]] command restores the Watch Window contents from a watch file.  

Revision as of 02:59, 8 December 2022

Action:

Saves to a local file the list of items currently displayed in the Watch Window, as described in Saving and restoring Watch Window contents.

The command's first optional argument is the name of the .watch file in which to store the Watch Window contents:

saveWatch [watchfile [overwrite]]

If you omit watchfile, a Windows file selection dialog box lets you create a .watch file when the command executes.

Otherwise, if you specify a watchfile argument (the .watch extension may be omitted), the Watch Window contents are stored in the named file when the command executes.

The Client saves the watch file in the folder that contains the JanusDebugger.exe file, by default.

If a watch file with the same name already exists when saveWatch executes, the result depends on whether you also specified the overwrite parameter:

  • If it is not specified, the saveWatch command fails, and an error message is issued.
  • If it is specified, the existing file gets overwritten.

You may also specify the watch file name in these ways:

*As a macro variable. For example:

set &a = "foo" saveWatch &a overwrite 

  • With an absolute file system path, which must be enclosed in quotation marks.

saveWatch "c:\temp\foo.watch" saveWatch "c:\temp\foo.watch" overwrite 

The loadWatch command restores the Watch Window contents from a watch file.

Client menu: Data Display > Save Watch
Introduced: Build 49