Topic: Columnar block macros (1 of 1), Read 28 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Friday, January 07, 2005 05:11 PM

Berndt's recent column block questions reminded me of a related "subtle" issue.

Consider having a columnar block highlighted. Then you might expect that the following command would copy it to register 9:

Reg_Copy_Block(9,BB,BE,COLUMN) //Wrong

However, because block operations are defined as "up to but not including the end pointer" (e.g. BE), the right-most highlighted column will not be included in the copy. :-(

However, to better handle columnar blocks, the end-pointer is included when the "COLSET" option is specified. Therefore the following command works correctly:

Reg_Copy_Block(9,BB,BE,COLUMN+COLSET,CB,CE) //Correct

Writing a macro to simulate the {BLOCK, Copy to register} function is tedious and complex because it needs different commands for stream, line and columnar functions.

Therefore, I just implemented a new "DIALOG" option to simplify all this:

Reg_Copy_Block(r,0,0,DIALOG)

which is the same as {BLOCK, Copy to register}. The block markers and block type are automatically set from the currently highlighted block. Be sure to only use the DIALOG option for macros run from Visual Mode. To be safe you could use:

if (Visual_Macro & 08) {
Reg_Copy_Block(9,0,0,DIALOG)
}

Currently, this DIALOG option is also available on one other command:

Block_Save_As("file",0,0,DIALOG)

(This DIALOG option is only available on .EXE files after Jan. 7, 2005).

Ted.





Ted.
-------------------------------------------------------------------------
Ted Green (ted@...) Greenview Data, Inc.
Web: www.... Fax: 734-996-1308 PO Box 1586, Ann Arbor, MI 48106
Tel: (734) 996-1300 Desk: 734-369-3550 VEDIT - Text/Data/Binary Editor
-------------------------------------------------------------------------
www.SpamStopsHere.com ranked #1 in accuracy by Network Computing Magazine