godoc Command

Go to or create a named document (file) in a Source view or in an Editor window.

Scope: Global

Syntax

Parameters

name 
Switch to the named document. If it is not open, create it.
find 
Switch to the named document. If it is not open in the Editor, do not create it.
DocumentName 
To switch to an open document, you must use the document file name as it is displayed in the title bar and as is returned by the query name command. If you do not specify a path name when creating a new document file, the file is placed in the current directory when it is saved.
docnum 
Switch to the document specified by DocumentNumber. If the document is not open, do not create it. DocumentNumber must be the number returned by the query docnum command.
newring 
The document, if created, is opened into a new ring in the Editor window.
split
If specified, an Editor window is split to accommodate the new ring and document. Otherwise, a new Editor window is opened.
Note: This parameter is only valid when issued in an Editor window.
nonewring 
The document, if created, is opened as a member of the current ring.
Note: This parameter is only valid when issued in an Editor window.
next 
Shows the next document in the sequence.

Description

The godoc command switches to the specified document. If used with no parameters, it switches to the next open document, beginning with the most recently used document.

When you specify a parameter and document file name, the Editor ignores case when making comparisons, though it stores a new name exactly as typed.

If you create a new document without specifying one of the nonewring or newring parameters, the new document is placed in a new or existing ring according to the value of the ring parameter.

The godoc command searches only documents already opened in a Source view or in an Editor window. If the specified document exists on the disk but is not opened in the Editor, godoc ignores it and creates a new document with the specified file name. When you save this new document, you will overwrite the existing file on the disk.

Note: The godoc command does not load any profiles when creating a new document.

Examples

  1. To create a document called rester.c, type:
    godoc name rester.c

    The document is created. If saved, it is placed in the current directory.

  2. To switch to a document with document number of 71, type:
    godoc docnum 71 

    The document must already be open for docnum to display it. If it is not open, the document file is not created.

  3. To switch to a document called /lpex/samples/tester.doc, type:
    godoc find /lpex/samples/tester.doc

    To switch to a document called \lpex\samples\tester.doc, type:

    godoc find \lpex\samples\tester.doc

    If the document is not found, it is not created.

  4. To create a new document in a new ring, type:
    godoc newring name mynewdoc 

API Return Codes

-1 
You typed a parameter that is not valid.
-2 
DocumentNumber must be in the range 1 to 9999.
-3 
There was an attempt to move to a new document during trigger processing.
-4 
Exceeds the maximum number of views in a ring.
Note: See the name parameter for additional API return codes when the name option in this command is used.

doclist Parameter
docnum Parameter
lx Command
name Parameter
quit Command
ring Parameter
windowshow Parameter