Topic: Text Register (1 of 6), Read 36 times
Conf: VEDIT Macro Language Support
From: Tony Fernandez
Date: Friday, December 10, 2004 03:23 PM

Tried to search the MACRO Language Ref Manual but can't find the answer to the following.
How do I append special characters like TAB, NEWLINE, when executing commands like reg_set(r,text,APPEND)?

thanks,
Tony

 


Topic: Re: Text Register (2 of 6), Read 31 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Friday, December 10, 2004 06:42 PM

At 03:24 PM 12/10/2004, you wrote:
>Tried to search the MACRO Language Ref Manual but can't find the answer to the following.
>How do I append special characters like TAB, NEWLINE, when executing commands like reg_set(r,text,APPEND)?

You can enter any characters in the "text" portion, even Newlines, which
then cause the command to be several lines long.

Ted.

 


Topic: Re: Text Register (3 of 6), Read 35 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, December 11, 2004 02:44 AM

On Fri, 10 Dec 2004 18:42:00 -0500, Ted Green wrote:

>At 03:24 PM 12/10/2004, Tony Fernandez wrote:
>>Tried to search the MACRO Language Ref Manual but can't find
>>the answer to the following.
>>How do I append special characters like TAB, NEWLINE, when
>>executing commands like reg_set(r,text,APPEND)?
>
>You can enter any characters in the "text" portion, even Newlines,
>which then cause the command to be several lines long.


Tony:

Here an example with an additional way of doing it:


// Setting a text register with "embedded" CR/LF:
Reg_Set(2, "First line
next line")

// Setting a text register with characters by ASCII-Value(s)

// (Note: if inserting TAB's you should pay attention to the
// following Config option)
// Disable TAB expansion (and remember the original setting)
#103=Config( E_EXP_TAB, "Expand key with spaces (*)", 0 )

Out_Reg(2, APPEND)
Type_Char(9) // insert a TAB
Type_Char(64) // insert a "@"
Type_Newline(1)
Out_Reg(CLEAR)

// Restore the TAB expansion setting:
Config( E_EXP_TAB, "Expand key with spaces (*)", #103 )

// Append normal text again
Reg_Set(2, "End", APPEND)


But note:

Unfortunately that doesn't work correctly with TABs here (6.13.1):

Type_Char(9) doesn't honor the Config(E_EXP_TAB,0) and always inserts
spaces!
That seems to be a bug?!


Christian

 


Topic: Re: Text Register (4 of 6), Read 37 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, December 11, 2004 03:31 AM

On Sat, 11 Dec 2004 02:44:00 -0500, I wrote:

>// Setting a text register with characters by ASCII-Value(s)
>
>// (Note: if inserting TAB's you should pay attention to the
>// following Config option)
>// Disable TAB expansion (and remember the original setting)
>#103=Config( E_EXP_TAB, "Expand key with spaces (*)", 0 )
>
>Out_Reg(2, APPEND)
>Type_Char(9) // insert a TAB
>Type_Char(64) // insert a "@"
>Type_Newline(1)
>Out_Reg(CLEAR)
>
>[...]
>
>Type_Char(9) doesn't honor the Config(E_EXP_TAB,0) and always
>inserts spaces!


You can alternatively use Char_Dump(n, NOCR) instead of Type_Char().
Char_Dump() always inserts the given character only.

e.g:

Char_Dump(9, NOCR) // insert a TAB character


Christian

 


Topic: Re: Text Register (5 of 6), Read 29 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Friday, January 07, 2005 06:08 PM

At 02:45 AM 12/11/2004, you wrote:
>Type_Char(9) doesn't honor the Config(E_EXP_TAB,0) and always inserts
>spaces!
>That seems to be a bug?!

It is not a bug. Type_Char() is a "display" command and therefore honors the current display mode, set by Config(D_DSP_MODE) or by pressing (repeatedly). If the display mode is set to "4" for "Show all chars", then Type_Char(9) will display/insert a true Tab.

Going back to the original question, the Reg_Set() command will insert absolutely any characters into a text register.

Ted.

 


Topic: Re: Text Register (6 of 6), Read 27 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, January 09, 2005 02:20 AM

On Fri, 07 Jan 2005 18:08:00 -0500, Ted Green wrote:

>At 02:45 AM 12/11/2004, you wrote:
>>Type_Char(9) doesn't honor the Config(E_EXP_TAB,0)
>>and always inserts spaces!
>>That seems to be a bug?!
>
>It is not a bug. Type_Char() is a "display" command and
>therefore honors the current display mode, set by
>Config(D_DSP_MODE) or by pressing (repeatedly).
>If the display mode is set to "4" for "Show all chars", then
>Type_Char(9) will display/insert a true Tab.

Sometimes it's easy to confuse/misunderstand the meaning of VEDITs
commands, especially of those regarding display or visual mode...
(Even if working with VEDIT for many years!)

But bit by bit it's getting better.


Christian