Topic: Re: Extending opencurs.vdm (1 of 31), Read 91 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Sunday, May 21, 2006 03:29 PM

On Fri, 12 May 2006 16:53:00 -0400, Ian Davies wrote:

>[opencurs.vdm]
>
>It occurs to me to wonder if anyone has written something similar
>but extending the method to open other sorts of files using the
>same technique. For example it would be great if browsing a list
>in Vedit, I could "open" say a .JPG file,
>or a .PDF file, using the default application.

Here an enhanced version of opencurs.vdm:

http://www.ziemski.net/vedit/macros/opencurs.vdm


It's a first try, but seems to work well.

For now you have to hold the Ctrl key down when selecting
- {File, Open (More...), Open file at cursor} or
- the appropriate context menu entry
to instruct the macro not to open the file in VEDIT but in its
standard application.

(Technically: Or numerical register #103 has to be set to "5" at macro
call (to be used from other macros or future menu entries).)


BTW: The macro contains some more changes (compared with the
distributed one out of 2004), but they are internally.


Christian

 


Topic: Re: Extending opencurs.vdm (2 of 31), Read 76 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Sunday, May 21, 2006 06:06 PM


I added a little security now:

If the file to be opened with its application has an extension of
[.exe .bat .cmd .com .pif .scr .lnk .reg]
a warning dialog will pop up and let the user decide if he really
wants to execute that file.

http://www.ziemski.net/vedit/macros/opencurs.vdm


Christian

 


Topic: Re: Extending opencurs.vdm (3 of 31), Read 77 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Thursday, January 10, 2008 01:21 PM

At 02:29 PM 5/21/2006, you wrote:
>From: "Christian Ziemski"
>
>Here an enhanced version of opencurs.vdm:
>
>http://www.ziemski.net/vedit/macros/opencurs.vdm
>
>
>It's a first try, but seems to work well.
>
>For now you have to hold the Ctrl key down when selecting
> - {File, Open (More...), Open file at cursor} or
> - the appropriate context menu entry
>to instruct the macro not to open the file in VEDIT but in its
>standard application.

I have added this to the upcoming 6.15.2 version.

Very nice! Too cool for school!

Christian: You can look up that expression at:

http://www.urbandictionary.com/define.php?term=too+cool+for+school

:-)

Ted.


Ted.
-------------------------------------------------------------------------
Ted Green (support@...) Greenview Data, Inc.
Web: www.... 8178 Jackson Rd., Ann Arbor, MI
Tel: (734) 426-7500 Fax: 734-426-7510 VEDIT - Text/Data/Binary Editor
-------------------------------------------------------------------------
www.SpamStopsHere.com ranked #1 in accuracy by Network Computing Magazine

 


Topic: Re: Extending opencurs.vdm (4 of 31), Read 86 times
Conf: Keyboard, keystroke macros
From: Pauli Lindgren
Date: Tuesday, October 14, 2008 04:51 AM

On 1/10/2008 1:21:05 PM, Ted Green wrote:
>> From: "Christian Ziemski"
>>
>> Here an enhanced version of opencurs.vdm:
>
> I have added this to the upcoming 6.15.2 version.

There is a small problem with opencurs.vdm.

I tried to use "Open file at cursor" menu command to open some files I had listed (with full path) in a text file. I got error message:
"Error! Word too large!".

It was the same whether or not I had highlighted the path.

I then noticed that opencurs.vdm limits the path length to 100 characters. That is too short. Many of my files have pathname length around 110 to 140 characters.

I increased the limit to 150, and now it works. But maybe 200 would be more safe value.

Also, the error message is not very descriptive.

--
Pauli

 


Topic: Re: Extending opencurs.vdm (5 of 31), Read 100 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Tuesday, October 14, 2008 10:48 AM

At 05:23 AM 10/14/2008, you wrote:
>I then noticed that opencurs.vdm limits the path length to 100 characters. That is too short. Many of my files have pathname length around 110 to 140 characters.
>
>I increased the limit to 150, and now it works. But maybe 200 would be more safe value.

I have tried to make every part of VEDIT support pathnames of at least 256 chars.

Ted.

 


Topic: Re: Extending opencurs.vdm (6 of 31), Read 140 times
Conf: Keyboard, keystroke macros
From: Ian Binnie
Date: Tuesday, October 14, 2008 07:50 PM

On 10/14/2008 10:48:26 AM, Ted Green wrote:
>At 05:23 AM 10/14/2008, you
>wrote:
>>I then noticed that opencurs.vdm limits the path length to 100 characters. That is too short. Many of my files have pathname length around 110 to 140 characters.
>>
>>I increased the limit to 150, and now it works. But maybe 200 would be more safe value.
>
>I have tried to make every
>part of VEDIT support
>pathnames of at least 256
>chars.
>
>Ted.
>

Windows programs (Explorer included) are limited to paths of MAX_PATH length (260, although MicroSoft sometimes lists as 256).

It makes sense for Vedit (and macros) to support 256, anywhere a filespec can be used.

In Win32, longer paths are possible (32K), but mainly needed for networks. I wonder if Vedit supports \\?\ - I would guess not, as it doesn't use Unicode.

 


Topic: Re: Extending opencurs.vdm (7 of 31), Read 148 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Wednesday, October 15, 2008 11:21 AM

At 07:56 PM 10/14/2008, you wrote:
>From: Ian Binnie
>Windows programs (Explorer included) are limited to paths of MAX_PATH length (260, although MicroSoft sometimes lists as 256).

And VEDIT is also 260.

>In Win32, longer paths are possible (32K), but mainly needed for networks. I wonder if Vedit supports \\?\ - I would guess not, as it doesn't use Unicode.

VEDIT supports simple UNC filenames like \\server1\data\ted\myfile.txt

Ted.

 


Topic: Re: Extending opencurs.vdm (8 of 31), Read 149 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Wednesday, October 15, 2008 04:32 PM

On 15.10.2008 01:56 in vtech-keystroke Ian Binnie wrote:
>
> On 10/14/2008 10:48:26 AM, Ted Green wrote:
>> At 05:23 AM 10/14/2008, Ian Binnie wrote:
>>> I then noticed that opencurs.vdm limits the path length to 100
>>> characters. That is too short. Many of my files have pathname
>>> length around 110 to 140 characters.
>>>
>>> I increased the limit to 150, and now it works. But maybe 200
>>> would be more safe value.
>>
>> I have tried to make every part of VEDIT support pathnames of at
>> least 256 chars.
>>
>
> Windows programs (Explorer included) are limited to paths of MAX_PATH
> length (260, although MicroSoft sometimes lists as 256).

As far as I can see the 100 character limitation in opencurs.vdm is not
really needed for "Open file at cursor".

But the other functions like "Open URL at cursor", "Open file at cursor
in standard application" do need some limitation because they use
VEDIT's Sys() command.
Sys() fails when given a too long parameter due to a Windows limitation
regarding the command line used in programs(!).
That issue has been discussed here a couple of times.

To be consistent opencurs.vdm checks/limits the filename/URL only once.
Against an appropriate value for all cases: 100.

Christian

 


Topic: Re: Extending opencurs.vdm (9 of 31), Read 155 times
Conf: Keyboard, keystroke macros
From: Ian Binnie
Date: Wednesday, October 15, 2008 08:21 PM

On 10/15/2008 4:32:22 PM, Christian Ziemski wrote:
>On 15.10.2008 01:56 in vtech-keystroke
>Ian Binnie wrote:

>As far as I can see the 100 character
>limitation in opencurs.vdm is not
>really needed for "Open file at cursor".
>
>But the other functions like "Open URL
>at cursor", "Open file at cursor
>in standard application" do need some
>limitation because they use
>VEDIT's Sys() command.
>Sys() fails when given a too long
>parameter due to a Windows limitation
>regarding the command line used in
>programs(!).

This is not a Windows limitation, but is due to the fact that DOS is calling a .pif, which invokes the 16 bit ntvdm handler.

I am not sure why you just can't call the command processor without the DOS, but it doesn't seem to work.

 


Topic: Re: Extending opencurs.vdm (10 of 31), Read 173 times, 1 File Attachment
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Thursday, October 16, 2008 03:53 AM

On 10/15/2008 8:21:59 PM, Ian Binnie wrote:
>
>I am not sure why you just can't call
>the command processor without the DOS,
>but it doesn't seem to work.

The Sys(), DOS-option, start command etc. are strange friends, especially when you have to support more than one Windows version.

I modified opencurs.vdm now to avoid the DOS option.
At the same time I increased the length limit for the filenames from 100 to 254. That is the max value I got working. On higher values Vedit complains "wrong filename".

The new version is attached to this message.

Please test it carefully, especially you Pauli, since you are using those long filenames...

Christian

 
OPENCURS(2).VDM (12KB)

 


Topic: Re: Extending opencurs.vdm (11 of 31), Read 178 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Thursday, October 16, 2008 04:04 AM

Technical PS:
If you received my last message with the attached opencurs.vdm ***via mail or NNTP*** you got a wrong attachment!
Please get the correct one from Webboard.
Sorry for the inconvenience.

 


Topic: Re: Extending opencurs.vdm (13 of 31), Read 175 times
Conf: Keyboard, keystroke macros
From: Pauli Lindgren
Date: Thursday, October 16, 2008 11:40 AM

On 10/16/2008 3:53:07 AM, Christian Ziemski wrote:
>
>At the same time I increased the length
>limit for the filenames from 100 to 254.
>
>The new version is attached to this
>message.
>
>Please test it carefully, especially you
>Pauli, since you are using those long
>filenames...

I did a quick test and it worked OK.
However, there is still 100 character limit for "small block" (line 107).

--
Pauli

 


Topic: Re: Extending opencurs.vdm (14 of 31), Read 186 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Thursday, October 16, 2008 12:48 PM

On 16.10.2008 18:01 in vtech-keystroke Pauli Lindgren wrote:
>
> On 10/16/2008 3:53:07 AM, Christian Ziemski wrote:
>> At the same time I increased the length
>> limit for the filenames from 100 to 254.
>>
>> The new version is attached to this
>> message.
>>
>> Please test it carefully, especially you
>> Pauli, since you are using those long
>> filenames...
>
> I did a quick test and it worked OK.

Fine.

> However, there is still 100 character limit for "small block" (line 107).

Yes, but that has nothing to do with the other limit.

What kind of block handling do you suggest here?
- simply define blocks up to 254 bytes "small" now (instead of 100)
- no longer check the block-size, but only that linecount==1
- no longer a special block handling at all
- ...

I think I prefer the second option above.

Christian

 


Topic: Re: Extending opencurs.vdm (15 of 31), Read 229 times, 1 File Attachment
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Thursday, October 16, 2008 03:00 PM

I attached a new version of opencurs.vdm.

Changes:
An optionally highlighted block is only checked to be a one-liner now and then copied to a register.
Then this register is checked for a maximum length of 254, but later than before: just *after* some possible modifications (see code).

I think that will not be the final solution because
a) due to pathnames, esp. relative ones, there is more length-checking needed
b) Unfortunately I found a bug in VEDIT's filename handling with those looong filenames.

I will report the bug to Ted by mail later this night.
Or should I post it here, Ted?

Christian

 
OPENCURS(3).VDM (12KB)

 


Topic: Re: Extending opencurs.vdm (17 of 31), Read 255 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Friday, October 17, 2008 10:35 AM

At 03:32 PM 10/16/2008, you wrote:
>From: "Christian Ziemski"
>
>I attached a new version of opencurs.vdm.
>
>Changes:
>An optionally highlighted block is only checked to be a one-liner now and then copied to a register.
>Then this register is checked for a maximum length of 254, but later than before: just *after* some possible modifications (see code).
>
>I think that will not be the final solution because
>a) due to pathnames, esp. relative ones, there is more length-checking needed
>b) Unfortunately I found a bug in VEDIT's filename handling with those looong filenames.
>
>I will report the bug to Ted by mail later this night.
>Or should I post it here, Ted?

Christian:

Thank you for the new opencurs.vdm!
I received your bug report and will check it this weekend.

Ted.

 


Topic: Re: Extending opencurs.vdm (22 of 31), Read 233 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Saturday, December 27, 2008 11:44 PM

On 10/16/2008 3:00:38 PM, Christian Ziemski wrote:
>I attached a new version of
>opencurs.vdm.
>
>Changes:
>An optionally highlighted
>block is only checked to be a
>one-liner now and then copied
>to a register.
>Then this register is checked
>for a maximum length of 254,
>but later than before: just
>*after* some possible
>modifications (see code).
>
>I think that will not be the
>final solution because
>a) due to pathnames, esp.
>relative ones, there is more
>length-checking needed
>b) Unfortunately I found a bug
>in VEDIT's filename handling
>with those looong filenames.
>
>I will report the bug to Ted
>by mail later this night.
>Or should I post it here, Ted?

Thanks Christian,

for your opencurs.vdm enhancement.I would like to use it as a tutorial and so, I have a simple question concerning your line 218, which says:

Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in application

This is the line which "avoids the old DOS option", that is to say the vedit .PIF file. Here, T-Reg 106 is defined by
your line213, which says

Reg_Set(106, "cmd /c ") // use cmd command to be able to avoid DOS option. I could not track down the definition of T-Reg 121, but I think I can ask my question withoiut it.

In short I would like to know what

Sys(`|@(106) "|@(121)"`)

means. One interpretation is that it transmits the parameters between the ` ` delimiters to the windows command interpreter, cmd.exe.
That is is to say it transmits the concatenation of the content of T-Reg 106 and of the content of the "double quoted version " of T_Reg 121. Of course, there might be many other reasons why only one of these text registers have the "double quotes" around them.

Thanks as always,

-peter.

 


Topic: Re: Extending opencurs.vdm (23 of 31), Read 255 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Sunday, December 28, 2008 06:08 AM

On 28.12.2008 06:07 vtech-keystroke Listmanager wrote:
> From: "Peter Rejto"
>
> [thanks] for your opencurs.vdm enhancement.I would like to use it as
> a tutorial and so, I have a simple question concerning your line 218,
> which says:
>
> Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in appl
>
> This is the line which "avoids the old DOS option", that is to say
> the vedit .PIF file. Here, T-Reg 106 is defined by your line213,
> which says
>
> Reg_Set(106, "cmd /c ") // use cmd command to avoid DOS option.
>
> I could not track down the definition of T-Reg 121,

It's in line 143 and earlier.

> but I think I can ask my question withoiut it.
>
> In short I would like to know what
>
> Sys(`|@(106) "|@(121)"`)
>
> means. One interpretation is that it transmits the parameters between
> the ` ` delimiters to the windows command interpreter, cmd.exe. That
> is is to say it transmits the concatenation of the content of T-Reg
> 106 and of the content of the "double quoted version " of T_Reg 121.

Yes, it sends the string
cmd /C "C:\some path with or without spaces\a file to open.txt"
to Windows.

> Of course, there might be many other reasons why only one of these
> text registers have the "double quotes" around them.

The last part of the string needs to be in double quotes because of
optional spaces within the path or filename.

The first part doesn't have such spaces.

The handling of spaces in path/filenames in Windows is horrible and
trying to manage all cases makes some VEDIT macros a bit complicated.
You will find several Sys(), File_Open() etc. commands with stacked
single and double quotes.

It's far beyond my time to explain in detail here. Sorry.

Rule of thumb:
If there are spaces in path/filename:
Use double quotes around the path/filename.
Use different quotes around the complete string in Vedit then.

Christian

 


Topic: Re: Extending opencurs.vdm (24 of 31), Read 270 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Sunday, December 28, 2008 10:49 PM

On 12/28/2008 6:08:09 AM, Christian Ziemski wrote:
>On 28.12.2008 06:07 vtech-keystroke
>Listmanager wrote:
>> From: "Peter Rejto"

>> Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in appl
>>

>Yes, it sends the string
>cmd /C "C:\some path with or without
>spaces\a file to open.txt"
>to Windows.

>The last part of the string needs to be
>in double quotes because of
>optional spaces within the path or
>filename.
>
>The first part doesn't have such spaces.
>
>The handling of spaces in path/filenames
>in Windows is horrible and
>trying to manage all cases makes some
>VEDIT macros a bit complicated.
>You will find several Sys(), File_Open()
>etc. commands with stacked
>single and double quotes.
>
>It's far beyond my time to explain in
>detail here. Sorry.
>
>Rule of thumb:
>If there are spaces in path/filename:
>Use double quotes around the
>path/filename.
>Use different quotes around the complete
>string in Vedit then.
>
>Christian


Thanks Christian,

Now I understand why did you put double quotes outside the content of the second text register, but not the first one.

I like very much your idea of using double quotes outside the content of a text register and not using it inside.
It reduces the level of the stacking of the double quotes. Since this stacking is horrible I am grateful for any help that I can get in reducing it!

In fact, I already have used your idea to diagnose my aspell.exe installation. Here I ended up using two text registers for the argument of my System( ) command together with some text. This worked like a charm. More specifically, I did succeed in printing a help file for this program. Here are the details:

\\
Reg_Set(106, "cmd %comspec% /k ")
Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
System(`|@(106),"|@(107)" >aspell.tpl`)
OK
\\

I also like your idea of using two text registers as an argument for the System( ) macro command. So, I thought to put my text into a text register and generalize your idea from two to three. To my great surprise I did not succeed.
I find it hard to believe that I can use two text registers as an argument for System( ), but I can not use three. I am attaching the details:

Reg_Set(106, "cmd %comspec% /k ")
Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
Reg_Set(108," >aspell.tpl ")
System(`|@(106),"|@(107)",|@(108)`)
Error from cmd.exe: Unknown Action.

In fact, I am at a loss of interpreting the error message Unknown Action, which came from cmd.exe. It seems to me that Vedit did her job and transmitted the content of those three text registers to cmd.exe. To my untrained eyes the content of the arguments of those two System( ) are the same. Of course, it is also possible that I made a typo somewhere ?

Thanks as always,

-peter.

 


Topic: Re: Extending opencurs.vdm (25 of 31), Read 281 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Monday, December 29, 2008 03:29 PM

On 29.12.2008 05:09 in vtech-keystroke Peter Rejto wrote:
>
> In fact, I already have used your idea to diagnose my aspell.exe
> installation. Here I ended up using two text registers for the
> argument of my System( ) command together with some text. This worked
> like a charm. More specifically, I did succeed in printing a help
> file for this program. Here are the details:
>
> Reg_Set(106, "cmd %comspec% /k ")

That is doubled!
The environment variable COMSPEC contains "C:\WINNT\system32\cmd.exe"
and so a Reg_Set(106, "%comspec% /k ") should be enough.

> Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
> System(`|@(106),"|@(107)" >aspell.tpl`)
> OK

System() has only ONE string argument!
So the above should read:
System(`|@(106) "|@(107)" >aspell.tpl`)

No comma but a space character after @(106)!
It's one string argument only.

> I also like your idea of using two text registers as an argument for
> the System( ) macro command. So, I thought to put my text into a text
> register and generalize your idea from two to three. To my great
> surprise I did not succeed. I find it hard to believe that I can use
> two text registers as an argument for System( ), but I can not use
> three. I am attaching the details:
>
> Reg_Set(106, "cmd %comspec% /k ")
> Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
> Reg_Set(108," >aspell.tpl ")
> System(`|@(106),"|@(107)",|@(108)`)
> Error from cmd.exe: Unknown Action.

That is what you give Windows to execute here (one long line):

cmd C:\WINNT\system32\cmd.exe /k, "c:\program files
(x86)\aspell\bin\aspell.exe", >aspell.tpl

Note the two commas. They are the problem. See above.


> In fact, I am at a loss of interpreting the error message Unknown
> Action, which came from cmd.exe. It seems to me that Vedit did her
> job and transmitted the content of those three text registers to
> cmd.exe. To my untrained eyes the content of the arguments of those
> two System( ) are the same.

The only strange thing is that your first try with two concatenated
strings and the single comma worked.
cmd.exe should have complained here too.


Christian

 


Topic: Re: Extending opencurs.vdm (26 of 31), Read 284 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Tuesday, December 30, 2008 12:57 AM

On 12/29/2008 3:29:30 PM, Christian Ziemski wrote:
>On 29.12.2008 05:09 in vtech-keystroke
>
>The only strange thing is that your
>first try with two concatenated
>strings and the single comma worked.
>cmd.exe should have complained here too.

Thanks Christian,


Your suggestion works like a charm!

In other words, a big thank you for finding my typo. Now I realize that in adapting your System( ) command to my situation, I also introduced a "single comma". This was exactly the typo that killed it.


-peter

 


Topic: Re: Extending opencurs.vdm (27 of 31), Read 210 times
Conf: Keyboard, keystroke macros
From: Pauli Lindgren
Date: Tuesday, December 30, 2008 10:46 AM

On 10/16/2008 3:00:38 PM, Christian Ziemski wrote:
>I attached a new version of opencurs.vdm.
>
>Changes:
>An optionally highlighted
>block is only checked to be a
>one-liner now and then copied
>to a register.
>Then this register is checked
>for a maximum length of 254,
>but later than before: just
>*after* some possible
>modifications (see code).

I found another problem with this version.
If the filename is given without full path, the file is usually not found.

This is because opencurs.vdm only searches CUR_DIR.
Attempt to use current files directory does not work, because when the command Reg_Set(98,PATH_ONLY) is executed, a new (empty) buffer has already been opened.

To fix this, move the Reg_Set(98,PATH_ONLY) command somewhere before the command Buf_Switch(Buf_Free(EXTRA)).

--
Pauli

 


Topic: Re: Extending opencurs.vdm (28 of 31), Read 230 times, 1 File Attachment
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Tuesday, December 30, 2008 04:58 PM

On 12/30/2008 10:46:09 AM, Pauli Lindgren wrote:
>On 10/16/2008 3:00:38 PM, Christian Ziemski wrote:
>>I attached a new version of opencurs.vdm.
>
>I found another problem with this version.
>If the filename is given without full
>path, the file is usually not found.

Pauli:

Thank you for the bug report and the suggested fix.

The new version is attached.


Christian

 
OPENCURS(4).VDM (12KB)

 


Topic: Re: Extending opencurs.vdm (29 of 31), Read 158 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Tuesday, April 06, 2010 03:08 PM

First and foremost a big thank you for OPENCURS(4).VDM to Christian and to all the Vedit gurus who have explicitly or implicitly contributed.

Now, I would like to understand the use of T-Register 106 in this macro.

I think that Christian did a beautiful job in marking up his macro. So, I do understand many things about the use of T-Register 106. My problem is, I can not put these pieces together.

Here are the details of my breaking it up into tasks:

Task 1.:
Shell out to DOS: This is line 215:

Reg_Set(106, "cmd /c ")
// use cmd command to be able to avoid DOS option


Task 2.:
Find the browser program:
This is done in the subroutine :SETUP-HTTP:
starting on line 92


Task 3.:
Issue the final command.
This is done on line 344, with the command.

Sys(`|@(106)`,#106+NOWAIT) //Open file in browser



Now the details of my problem:
I do not understand how OPENCURS(4).VDM combines Task 1 and Task 2. If I would have to do this combination on my own I would use the command Reg_Set(...,APPEND) several times.


Thanks,

-peter

 


Topic: Re: Extending opencurs.vdm (30 of 31), Read 178 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Tuesday, April 06, 2010 03:52 PM

On 06.04.2010 21:08 in vtech-keystroke peter rejto wrote:
>
> Now, I would like to understand the use of T-Register 106 in this macro.
>
> Here are the details of my breaking it up into tasks:
>
> Task 1.:
> Shell out to DOS: This is line 215:
>
> Reg_Set(106, "cmd /c ")
> // use cmd command to be able to avoid DOS option
>
>
> Task 2.:
> Find the browser program:
> This is done in the subroutine :SETUP-HTTP:
> starting on line 92
>
>
> Task 3.:
> Issue the final command.
> This is done on line 344, with the command.
>
> Sys(`|@(106)`,#106+NOWAIT) //Open file in browser
>
>
>
> Now the details of my problem:
> I do not understand how OPENCURS(4).VDM combines Task 1 and Task 2. If I
> would have to do this combination on my own I would use the command
> Reg_Set(...,APPEND) several times.


Peter:

You can't find the combination here because there is no. ;-)

Your "Task 1" is used for "//Open the file in its std. application"
(line 198).
That is unrelated to using a browser that is done in "tasks 2 and 3".

T-Reg 106 is used in both parts, but differently.


Christian

 


Topic: Re: Extending opencurs.vdm (31 of 31), Read 20 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Monday, January 10, 2011 11:21 AM

Christian,

I would like to give you a progress report on using your
Opencurs.vdm, with the {File, Open(More), Open file at cursor} option:

Say, I would like to display the content of of my snippets.zip file in Vedit, using my 7-zip.exe.
In other words, I am asking Opencurs.vdm to find a "standard application" for snippets.zip

So, I shelled to DOS and with the help of the dir command I made a list of my snippet directory where snippets.zip resides. I called this file snippets.dir. Then I opened this file in Vedit and put the cursor on snippets.zip. Also, as per instructions I pressed and then
choose the {File, Open(More), Open file at cursor} Vedit menu commands.

This did work for me.

Now I would like to identify the snippet of your Opencurs.vdm, which does this. In particular I would like to know, how does Opencurs.vdm call my 7-zip.exe program.


Thanks as always.

-peter

 


Topic: Re: Extending opencurs.vdm (12 of 31), Read 173 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Thursday, October 16, 2008 11:05 AM

At 08:29 PM 10/15/2008, you wrote:
>This is not a Windows limitation, but is due to the fact that DOS is calling a .pif, which invokes the 16 bit ntvdm handler.
>
>I am not sure why you just can't call the command processor without the DOS, but it doesn't seem to work.

Correct. I'm not sure how to open another app with a specified filename without using the "DOS" option. Hopefully this can be resolved/corrected.

As was recently mentioned here, the DOS option absolutely does not work in 64bit Windows or Vista and I will look for a solution.

Ted.

 


Topic: Re: Extending opencurs.vdm (16 of 31), Read 177 times
Conf: Keyboard, keystroke macros
From: Ian Binnie
Date: Friday, October 17, 2008 12:54 AM

On 10/16/2008 11:05:58 AM, Ted Green wrote:
>At 08:29 PM 10/15/2008, you
>wrote:
>>This is not a Windows limitation, but is due to the fact that DOS is calling a .pif, which invokes the 16 bit ntvdm handler.
>>
>>I am not sure why you just can't call the command processor without the DOS, but it doesn't seem to work.
>
>Correct. I'm not sure how to
>open another app with a
>specified filename without
>using the "DOS" option.
>Hopefully this can be
>resolved/corrected.
>
>As was recently mentioned
>here, the DOS option
>absolutely does not work in
>64bit Windows or Vista and I
>will look for a solution.

The easiest way to get a command processor is:-
char * Cmd = "C:\\WINDOWS\\system32\\cmd.exe";
_spawnl(_P_NOWAITO, Cmd, Cmd, "parameters", NULL );

or better (because you do not need to worry about path)
char * Cmd = "cmd.exe";
_spawnlp(_P_WAIT, Cmd, Cmd, "parameters", NULL );

Parameters can be a list of arguments, these do not need to be separate, as implied by the documentation.

If you simply want to execute a command, then return then system() is OK.


The above do not give you the ability to control the Window state.
You could try lnk files, but I have not found this works.
char * Cmd = "Command.lnk";
system(Cmd);

In 2K/XP the size of the screen buffer/window, font etc are saved in the registry (if the user has saved Properties).

You would probably achieve control over states using ShellExecute.

 


Topic: Re: Extending opencurs.vdm (18 of 31), Read 187 times
Conf: Keyboard, keystroke macros
From: Howard Goldstein
Date: Friday, October 17, 2008 04:04 PM

On 10/17/2008 12:54:08 AM, Ian Binnie wrote:
>The easiest way to get a command
>processor is:-
>char * Cmd =
>"C:\\WINDOWS\\system32\\cmd.exe";
>_spawnl(_P_NOWAITO, Cmd, Cmd,
>"parameters", NULL );
>
>or better (because you do not need to
>worry about path)
> char * Cmd = "cmd.exe";
>_spawnlp(_P_WAIT, Cmd, Cmd,
>"parameters", NULL );
>
Or better yet, use the value of the COMSPEC environment variable rather than hard coding CMD.EXE. This way, those of us who prefer a different command processor wouldn't be forced into using CMD.

--
Howard

 


Topic: Re: Extending opencurs.vdm (19 of 31), Read 193 times
Conf: Keyboard, keystroke macros
From: Ian Binnie
Date: Friday, October 17, 2008 08:00 PM

On 10/17/2008 4:04:11 PM, Howard Goldstein wrote:
>On 10/17/2008 12:54:08 AM, Ian Binnie
>wrote:

>Or better yet, use the value of the
>COMSPEC environment variable rather than
>hard coding CMD.EXE. This way, those of
>us who prefer a different command
>processor wouldn't be forced into using
>CMD.

The trouble is you need a command processor to interpret %ComSpec%
This can be done with:-

char * Cmd = "cmd.exe";
char * Cmd1 = "%ComSpec%";
_spawnlp(_P_NOWAITO, Cmd, Cmd1, "parameters", NULL );

I suppose you could always use getenv to get the value of %ComSpec%

Currently vedit uses the value encoded in the .PIF files.

 


Topic: Re: Extending opencurs.vdm (20 of 31), Read 206 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Monday, October 20, 2008 05:07 PM

At 08:06 PM 10/17/2008, you wrote:
>From: Ian Binnie
>
>On 10/17/2008 4:04:11 PM, Howard Goldstein wrote:
>>On 10/17/2008 12:54:08 AM, Ian Binnie
>>wrote:
>
>>Or better yet, use the value of the
>>COMSPEC environment variable rather than
>>hard coding CMD.EXE. This way, those of
>>us who prefer a different command
>>processor wouldn't be forced into using
>>CMD.
>
>The trouble is you need a command processor to interpret %ComSpec%
>This can be done with:-
>
> char * Cmd = "cmd.exe";
> char * Cmd1 = "%ComSpec%";
> _spawnlp(_P_NOWAITO, Cmd, Cmd1, "parameters", NULL );
>
>I suppose you could always use getenv to get the value of %ComSpec%
>
>Currently vedit uses the value encoded in the .PIF files.

Thanks for the additional info.
I will start working next week on getting VEDIT to work better with 64-bit Windows/Vista.

Ted.

 


Topic: Re: Extending opencurs.vdm (21 of 31), Read 210 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Tuesday, December 02, 2008 06:49 PM

On 10/20/2008 5:07:54 PM, Ted Green wrote:
>Thanks for the additional info.
>I will start working next week on
>getting VEDIT to work better with 64-bit
>Windows/Vista.


Ted,

I am looking forward to the enhanced version of Vedit.

I would also like to use this opportunity to thank Ian for his suggestion, which allowed me to use Vedit with my 64-bit Windows. Instead of using {Misc, Dos shell},
I put the following command into my USER menu:

1
Shell to DOS in Windows-XP-64x.
System(`cmd %comspec% /k cd "|(Cur_Dir)"`)


I made similar replacements for the Sysem(...,DOS) commands.

I have been using this setup for a few months and it seems to work for me.

-peter