QUERY and EXTRACT Changes

This chapter gives details of the changes made in KEDIT for Windows 1.5 to KEDIT's QUERY and EXTRACT operands. Where minor changes have been made, only the changes are discussed here. Where major changes have been made, or where new operands have been added, full documentation is given.

AUTOCOLOR

AUTOCOLOR is new in KEDIT for Windows 1.5.

Query AUTOCOLOR ext displays the name of the parser associated with the specified extension, or NULL if there is no such parser.

EXTract /AUTOCOLOR ext/ sets these variables:
autocolor.0 2
autocolor.1 Extension (with a leading period)
autocolor.2 Name of associated parser, or NULL
Query AUTOCOLOR * or simply Query AUTOCOLOR displays, for each extension that has an associated parser, the extension involved and the name of the parser.

EXTract /AUTOCOLOR/ or EXTRACT /AUTOCOLOR */ sets the following variables:
autocolor.0 number of extensions with associated parsers
autocolor.i ith extension (with a leading period) and parser

AUTOEXIT

AUTOEXIT is new in KEDIT for Windows 1.5.

Query AUTOEXIT displays whether AUTOEXIT is ON or OFF.

EXTract /AUTOEXIT/ sets these variables:
autoexit.0 1
autoexit.1 ON|OFF

BLOCK

BLOCK.8 is new in KEDIT for Windows 1.5.

Query BLOCK displays the type of block currently marked (LINE, BOX, STREAM, or NONE) and, if a block is defined, the file line and column of the start of the block, the file line and column of the end of the block, the fileid of the file containing the block, and whether the block is PERSISTENT or is a SELECTION. EXTract /BLOCK/ sets these variables:
block.0 8
block.1 LINE|BOX|STREAM|NONE
block.2 Line number of start of block (this and following values are set to the null string if no block is marked)
block.3 Column number of start of block
block.4 Line number of end of block
block.5 Column number of end of block
block.6 Fileid of file containing marked block
block.7 PERSISTENT|SELECTION
block.8 Contents of the currently marked one-line block, or the null string if there is no marked block or the marked block occupies multiple lines

CLIPBOARD

QUERY/EXTRACT CLIPBOARD is new in KEDIT for Windows 1.5.

Query CLIPboard displays information about the Windows clipboard.

When there is no text in the clipboard, Query CLIPboard returns NONE. Otherwise, Query CLIPboard returns the following information:

clipboard.0 5
clipboard.1 LINE|BOX|STREAM|FOREIGN or NONE
clipboard.2 If CLIPBOARD.1 = BOX, width of the box block; otherwise, the null string
clipboard.3 Size of clipboard text, in characters
clipboard.4 Size of clipboard text, in lines
clipboard.5 Contents of the clipboard, if the length of the text is less than or equal to the WIDTH setting, and otherwise the null string. The text may contain multiple lines of data, with carriage return and linefeed characters marking the end of each line.

ECOLOR

QUERY/EXTRACT ECOLOR now returns information about 35 different items, as opposed to 16 different items in KEDIT for Windows 1.0.

Query ECOLOR c displays the ECOLOR setting for the specified item, which must be in the range A -- Z or 1 -- 9.

EXTract /ECOLOR c/ sets these variables:
ecolor.0 1
ecolor.1 The letter or number that you specified, followed by the corresponding color.

Query ECOLOR * or simply Query ECOLOR displays the ECOLOR setting for each of the characters, A -- Z and 1 -- 9, used with ECOLOR.

EXTract /ECOLOR/ or EXTract /ECOLOR */ sets the following variables:
ecolor.0 35
ecolor.i ith character (A -- Z or 1 -- 9), followed by the corresponding color

FCASE

FCASE is new in KEDIT for Windows 1.5.

Query FCASE displays whether KEDIT is keeping fileids in all LOWER case, or whether fileids are kept ASIS (``as is'').

EXTract /FCASE/ sets these variables:
fcase.0 1
fcase.1 ASIS|LOWER

FIELD

FIELD.4 is new in KEDIT for Windows 1.5.

Query FIELD displays the contents of the cursor field, the character at the cursor location, the location of the cursor within the data of the cursor field, and the type of field involved (COMMAND, TEXT, or PREFIX).

EXTract /FIELD/ sets these variables:
field.0 4
field.1 Contents of cursor field
field.2 Character at cursor location
field.3 Location of cursor within data of cursor field
field.4 COMMAND|TEXT|PREFIX

FILEID, FPATH, FNAME, FEXT, FTYPE, EFILEID

For compatibility with previous releases of KEDIT, EXTRACT commands specifying these operands return as their first value the uppercase form of the fileid or fileid component involved.
In KEDIT for Windows 1.5, they also all return a second value with the fileid or fileid component in the case in which it is stored internally by KEDIT. In the 16-bit version of KEDIT, or in the 32-bit version of KEDIT with FCASE LOWER in effect, this result will be in lowercase. In the 32-bit version of KEDIT with FCASE ASIS in effect, this result will be in mixed case.

Here are the details for the FILEID operand; the others are similar:

EXTract /FILEId/ sets these variables:
fileid.0 2
fileid.1 Fileid of current file, in uppercase
fileid.2 Fileid of current file, in mixed case if FCASE ASIS is in effect or lowercase if FCASE LOWER is in effect
For example, in the 32-bit version of KEDIT with FCASE ASIS in effect, if you are editing the file "C:\TeMp FiLeS\My.FiLe", the results will be

FILEID.0 = 2
FILEID.1 = C:\TEMP FILES\MY.FILE
FILEID.2 = C:\TeMp FiLeS\My.FiLe

FILESEARCH

FILESEARCH is new in KEDIT for Windows 1.5.

When you use QUERY FILESEARCH fileid, KEDIT searches for fileid in the same way that it would if you issued a KEDIT command using that specified fileid. QUERY FILESEARCH returns information about the result of that search, but does not actually edit the specified file, as the KEDIT command would do.

QUERY FILESEARCH fileid returns ERROR if an error is encountered in searching for the file, RING if the specified file is already in the ring, DISK if the file is on disk and would be loaded into the ring by a KEDIT command, or NEW if the file does not already exist and would be edited as a new file.

When QUERY FILESEARCH fileid returns DISK, RING, or NEW, it also returns the fully-qualified name of the fileid involved, which can be affected by the path search KEDIT carries out for the file, and by settings like FCASE and DEFEXT.

For example, if SAMPLE.FIL is found in the current directory, the current directory is C:\TEST, and SAMPLE.FIL is not currently in the ring,

QUERY FILESEARCH SAMPLE.FIL
would return
DISK C:\TEST\SAMPLE.FIL
EXTract /FILESEARCH fileid/ sets these variables:
filesearch.0 1 if FILESEARCH.1 is ERROR, else 2
filesearch.1 DISK|RING|NEW|ERROR
filesearch.2 If FILESEARCH.1 is not ERROR, set to fully qualified fileid in the case (lower or mixed, as determined by the FCASE setting) that KEDIT would use to store the fileid internally

FILESTATUS

FILESTATUS.3 is new in KEDIT for Windows 1.5.

Query FILESTATUS displays three items:

  • The sharing mode under which the current file is locked: DENYWRITE or DENYREADWRITE, with NONE for a file that is not locked.

  • The type of access KEDIT has to the file: READONLY or READWRITE. KEDIT considers itself to have read-only access to a file if the file's directory entry was marked as read-only when KEDIT began editing the file. Otherwise, KEDIT considers itself to have read-write access to the file.

  • The third item is the end-of-line sequence KEDIT found at the end of the first line of the file when it read the file in. This can be CR, LF, or CRLF, indicating a carriage return, linefeed, or carriage return-linefeed pair. It can also be NONE, indicating that the file is a new file that did not exist on disk, that the file contained no end-of-line sequences, or that the file was read in with EOLIN NONE in effect. EXTract /FILESTATUS/ sets these variables:
filestatus.0 3
filestatus.1 DENYWRITE|DENYREADWRITE|NONE
filestatus.2 READONLY|READWRITE
filestatus.3 CR|LF|CRLF|NONE

FMODE

FMODE.2 is new in KEDIT for Windows 1.5, and returns a case sensitive version of the drive letter. FMODE has also been updated to reflect the possibility of a file with a UNC name, which has no drive specifier.

Query FMode displays the drive specifier of the current fileid as a drive letter followed by a colon, or displays NONE if the current fileid is a UNC name.

EXTract /FMode/ sets these variables:
fmode.0 2
fmode.1 Drive specifier of current fileid, in uppercase, or the null string if the current fileid is a UNC name.
fmode.2 Drive specifier of current fileid, in uppercase if FCASE ASIS is in effect or lowercase if FCASE LOWER is in effect, or the null string if the current fileid is a UNC name

OPSYS

The 32-bit version of KEDIT for Windows 1.5 returns information about whether KEDIT is running under Windows 95 or Windows NT.

Query OPSYS displays the name of the operating system KEDIT is running under and the operating system version number. For example, running under DOS 6.2, KEDIT would display DOS 6.20.

EXTract /OPSYS/ sets these variables:
opsys.0 3
opsys.1 Name of operating system
opsys.2 Version number of operating system
opsys.3 Additional identifying text or null string

If you want to test in a macro whether you are running under KEDIT for Windows, we recommend that you test whether VERSION.1 is equal to ``KEDIT/WINDOWS''.

The 16-bit version of KEDIT always returns DOS as the name of the operating system. The 32-bit version of KEDIT currently returns ``Windows 95'' or ``Windows NT''.

PARSER

PARSER is new in KEDIT for Windows 1.5.

Query PARSER parser displays the fileid of the KEDIT Language Definition file from which the specified parser was loaded, as specified on the SET PARSER command that defined the parser.

EXTract /PARSER parser/ sets these variables:
parser.0 2
parser.1 Parser name
parser.2 Fileid of .KLD file
Query PARSER * or simply Query PARSER displays, for each defined parser, the name of the parser and the fileid of the associated KLD file.

EXTract /PARSER/ or EXTRACT /PARSER */ sets the following variables:
parser.0 Number of parsers currently defined
parser.i Name of ith parser, and fileid of associated KLD file

PRINTPROFILE

PRINTPROFILE is new in KEDIT for Windows 1.5.

Query PRINTPROFile displays the fileid of the default printer profile macro.

EXTract /PRINTPROFile/ sets these variables:
printprofile.0 1
printprofile.1 Fileid of default printer profile macro

STARTUP

STARTUP was available, but undocumented, in KEDIT for Windows 1.0.

Query STARTUP displays information about how KEDIT was invoked:

  • The fully qualified name of the KEDIT module that is executing

  • The command line arguments passed to KEDIT or, if there were none, ``(none)''

  • The value of the KEDITW environment variable, or ``(none)''

  • The fully qualified name of the profile executed at the start of the current editing session, or ``(none)'' EXTract /STARTUP/ sets these variables:
startup.0 4
startup.1 The fully qualified name of the KEDIT module that is executing
startup.2 The command line arguments passed to KEDIT, or the null string
startup.3 The value of the KEDITW environment variable, or the null string
startup.4 The fully qualified name of the initial profile, or the null string

TABS

QUERY/EXTRACT TABS has changed in KEDIT for Windows 1.5 to return the current SET TABS setting in TABS.1, and the actual tab columns in TABS.2.

Query TABs displays the current tab setting (a list of specific tab columns, INCR n, or both)

EXTract /TABs/ sets these variables:
tabs.0 2
tabs.1 Current tab setting (a list of specific tab columns, INCR n, or both)
tabs.2 Current tab columns (up to a maximum response length of approximately 512 characters)

TARGET

TARGET.5 is new in KEDIT for Windows 1.5.

Query TARGet displays information about the target of the last CLOCATE, LOCATE, or TFIND command issued for any file in the ring: the line and column number within the file of the start of the matching target, and the line and column number of the end of the matching target. If the target was not a string target, the column pointer value is returned for both column numbers. In the current version of KEDIT, the line number of the start and end of the matching target will always be the same. EXTract /TARGet/ sets these variables:
target.0 5
target.1 Line number of start of target
target.2 Column number of start of target
target.3 Line number of end of target
target.4 Column number of end of target
target.5 Set equal to the text of the last string target. Valid only if your macro issues EXTRACT /TARGET/ immediately (that is, no intervening KEDIT commands) after successful use of the LOCATE, CLOCATE, or TFIND commands to search for a string target


KEDIT Home Page
KEDIT Versions and Features | Download Libraries | Maintenance Releases
Ordering/Licensing | Demo Version | Technical Support | What's New