Topic: Question about the Goto_Line( ) command. (1 of 12), Read 61 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Friday, September 03, 2004 05:23 PM

Hello,

I would like to open in Vedit the file, report.txt, and go to line number, say 15.


I can do each of these two commands individually like,

c:\vedit\vpw report.txt

and after the file has been opened, get into command mode and
type Goto_Line(15)


So, I tried :

c:\vedit\vpw.exe [VISUAL EXIT] Goto_Line(15)


However, for some reason this did not work for me.

What am I missing?

Thanks,

-peter.

 


Topic: Question about the Goto_Line( ) command. (2 of 12), Read 69 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Friday, September 03, 2004 09:43 PM

On 9/3/2004 5:23:49 PM, Peter Rejto wrote:
>Hello,
>
>I would like to open in Vedit
>the file, report.txt, and go
>to line number, say 15.
>

Why not c:\vedit\vpw report.txt -l15

See "Starting (Invoking) VEDIT" in help

>I can do each of these two
>commands individually like,
>
>c:\vedit\vpw report.txt
>
>and after the file has been
>opened, get into command mode
>and
>type Goto_Line(15)
>
>
>So, I tried :
>
>c:\vedit\vpw.exe [VISUAL
>EXIT] Goto_Line(15)
>
>
>However, for some reason this
>did not work for me.
>
>What am I missing?

This seems incomplete.
I am not sure what you are trying to do.
If you really want to execute commands from the cmd line use -c.

 


Topic: Question about the Goto_Line( ) command. (3 of 12), Read 74 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Friday, September 03, 2004 11:48 PM

On 9/3/2004 9:43:38 PM, Ian Binnie wrote:
>On 9/3/2004 5:23:49 PM, Peter Rejto
>wrote:
>>Hello,
>>
>>I would like to open in Vedit
>>the file, report.txt, and go
>>to line number, say 15.
>>
>
>Why not c:\vedit\vpw report.txt -l15
>
>See "Starting (Invoking) VEDIT" in help
>
>>I can do each of these two
>>commands individually like,
>>
>>c:\vedit\vpw report.txt
>>
>>and after the file has been
>>opened, get into command mode
>>and
>>type Goto_Line(15)
>>
>>
>>So, I tried :
>>
>>c:\vedit\vpw.exe [VISUAL
>>EXIT] Goto_Line(15)
>>
>>
>>However, for some reason this
>>did not work for me.
>>
>>What am I missing?
>
>This seems incomplete.
>I am not sure what you are trying to do.
>If you really want to execute commands
>from the cmd line use -c.


Thanks Ian:

I have also experimented with;

c:\vedit\vpw report.txt -c Goto_Line(15)


This command, indeed, does open the file report.txt in Vedit.
My problem is that the cursor is placed at the beginning of line number 1. So to achieve my aim, I would have to get into command mode and type

Goto_Line(15).


Of course, this does not involve much additional typing. Note that my problem is only a model problem, for the real problem of "Inverse Search". In the real problem, I have to tell my software what command to issue to Vedit. Therefore, I am seeking a single command which achieves this task.

Looking forward to hearing your reactions.

-peter.

 


Topic: Question about the Goto_Line( ) command. (4 of 12), Read 81 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Saturday, September 04, 2004 01:27 AM

On 9/3/2004 11:48:14 PM, Peter Rejto wrote:
>On 9/3/2004 9:43:38 PM, Ian Binnie
>wrote:
>>On 9/3/2004 5:23:49 PM, Peter Rejto
>>wrote:
>>>Hello,
>>>
>>>I would like to open in Vedit
>>>the file, report.txt, and go
>>>to line number, say 15.
>>>
>>
>>Why not c:\vedit\vpw report.txt -l15
>>
>>See "Starting (Invoking) VEDIT" in help

>c:\vedit\vpw report.txt -c
>Goto_Line(15)
>
>
>This command, indeed, does open the file
>report.txt in Vedit.
>My problem is that the cursor is placed
>at the beginning of line number 1. So to
>achieve my aim, I would have to get into
>command mode and type
>
>Goto_Line(15).
>
>

If you really want to construct your commands like this try:-
c:\vedit\vpw.exe -c 'file_open("D:\UserProfiles.txt") goto_line(15)'

Note the quotes.

This works, but be careful of command line length restrictions.

 


Topic: Question about the Goto_Line( ) command. (6 of 12), Read 82 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Saturday, September 04, 2004 09:51 AM

On 9/4/2004 1:27:12 AM, Ian Binnie wrote:

>If you really want to construct your
>commands like this try:-
>c:\vedit\vpw.exe -c
>'file_open("D:\UserProfiles.txt")
>goto_line(15)'
>
>Note the quotes.
>
>This works, but be careful of command
>line length restrictions.

Thanks Ian,

In particular thanks for pointing out the role of the quotes. This seems to be an entire family of macros and I plan to study them.

-peter.

 


Topic: Re: Question about the Goto_Line( ) command. (5 of 12), Read 77 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, September 04, 2004 03:28 AM

On Fri, 03 Sep 2004 23:48:00 -0400, Peter Rejto wrote:

>I have also experimented with;
>
>c:\vedit\vpw report.txt -c Goto_Line(15)
>
>
>This command, indeed, does open the file report.txt in Vedit.
>My problem is that the cursor is placed at the beginning of line number1.
>So to achieve my aim, I would have to get into command mode and type
>Goto_Line(15).

Peter:

You have to pay attention to the order of commandline parameters!

Try it this way:

c:\vedit\vpw -c Goto_Line(15) report.txt

The file(s) to be worked at should be at the end of the line!


Christian

 


Topic: Re: Question about the Goto_Line( ) command. (7 of 12), Read 74 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Saturday, September 04, 2004 10:16 AM

On 9/4/2004 3:28:54 AM, Christian Ziemski wrote:
>Peter:
>
>You have to pay attention to the order
>of commandline parameters!
>
>Try it this way:
>
>c:\vedit\vpw -c Goto_Line(15)
>report.txt
>
>The file(s) to be worked at should be at
>the end of the line!


Thanks Christian,

1. This is exclty that I have missed! Of course, your macro works like a charm.

2. I went back to my next problem. This problem concerns the interaction between my yap.exe program and vpw.exe programs. Fortunately, all I need to know about this interaction is the yap dictionary saying that th epercentage sign, % , is a place holder. More specifically, %l is a place holder for the line number and, %f , is a place holder for the filename. That is to say, %f extends to the actual file name and, %l extends to the actual line number. So, using this dictionary, I have replaced report.txt by %f and replaced
15 by %l. After these replacements your macro gave:

c:\vedit\vpw -c Goto_Line(%l) %f


To my great surprise, this is exactly, that I have found in my yap.exe program, under Inverse Search. Note that I have arrived at this answer after some experimentation. In those experiments I have followed the insrtuctions of Fritz.
Looking at Fritz's instructions, now I see that he was ware of the order issue. Is there an explicit reference to this order? If Fritz get around to reading this message I would appreciate hearing from him.



In short, I can replace my previous experiments by
combining your macro with the yap dictionary.

Also, I have been lucky, in fact very lucky, that the double quote issue did not appear in my problem. On the other hand, it did appear in Ian's solution.

Thanks again gentleman!

-peter.

 


Topic: Re: Question about the Goto_Line( ) command. (9 of 12), Read 76 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, September 04, 2004 12:01 PM

On Sat, 04 Sep 2004 10:16:00 -0400, Peter Rejto wrote:

>Looking at Fritz's instructions, now I see that he was ware of the
>order issue.
>Is there an explicit reference to this order?

For example here:

Online help:
Basics
Starting VEDIT (Invocation options)
Invocation Options (All Versions)

== VEDIT supports numerous invocation options. The syntax is:
==
== vpw +options -options filename -a outfile

>Also, I have been lucky, in fact very lucky, that the double quote
>issue did not appear in my problem. On the other hand,
>it did appear in Ian's solution.

You only have to use quotes if there is one or more space in the -c
option
(and not only there: e.g. filenames with spaces need quotes too.)

For example:

c:\vedit\vpw -c "Goto_Line(15) Goto_Col(20)" report.txt


Christian

 


Topic: Re: Question about the Goto_Line( ) command. (8 of 12), Read 78 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Saturday, September 04, 2004 10:23 AM

On 9/4/2004 3:28:54 AM, Christian Ziemski wrote:
>Peter:
>
>You have to pay attention to the order
>of commandline parameters!
>
>Try it this way:
>
>c:\vedit\vpw -c Goto_Line(15)
>report.txt
>
>The file(s) to be worked at should be at
>the end of the line!


Thanks Christian,

1. This is exclty that I have missed! Of course, your macro works like a charm.

2. I went back to my next problem. This problem concerns the interaction between my yap.exe and vpw.exe programs. Fortunately, all I need to know about this interaction is the yap dictionary saying that the percentage sign, % , is a place holder. More specifically, %l is a place holder for the line number and, %f , is a place holder for the filename. That is to say, %f extends to the actual file name and, %l extends to the actual line number. So, using this dictionary, I have replaced report.txt by %f and replaced
15 by %l. After these replacements your macro gave:

c:\vedit\vpw -c Goto_Line(%l) %f


To my great surprise, this is exactly, that I have found in my yap.exe program, under Inverse Search. Note that I have arrived at this answer after some experimentation. In those experiments I have followed the insrtuctions of Fritz.
Looking at Fritz's instructions, now I see that he was ware of the order issue. Is there an explicit reference to this order? If Fritz gets around to reading this message I would appreciate hearing from him.



In short, I can replace my previous experiments by
combining your macro with the yap dictionary.

Also, I have been lucky, in fact very lucky, that the double quote issue did not appear in my problem. On the other hand, it did appear in Ian's solution.

Thanks again gentleman!

-peter.

 


Topic: Re: Question about the Goto_Line( ) command. (10 of 12), Read 66 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Saturday, September 04, 2004 09:04 PM

On 9/4/2004 10:23:02 AM, Peter Rejto wrote:

>2. I went back to my next problem. This
>problem concerns the interaction between
>my yap.exe and vpw.exe programs.
>Fortunately, all I need to know about
>this interaction is the yap dictionary
>saying that the percentage sign, % ,
>is a place holder. More specifically, %l
>is a place holder for the line number
>and, %f , is a place holder for the
>filename.
>
>c:\vedit\vpw -c Goto_Line(%l) %f

This works, but if this is all you want to do you should use
c:\vedit\vpw %f -l%l

This is the standard used in compiler interaction.

For example for MS VC6.00++ I use:-
c:\vedit\vpw -cGC($(CurCol)) "$(FilePath)" -l$(CurLine)

There is a description of how to set this up on the Vedit web page.

 


Topic: Re: Question about the Goto_Line( ) command. (11 of 12), Read 71 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, September 05, 2004 04:24 AM

On 05.09.2004 03:04 Ian Binnie wrote:

> On 9/4/2004 10:23:02 AM, Peter Rejto wrote:
>
>>c:\vedit\vpw -c Goto_Line(%l) %f
>
>
> This works, but if this is all you want to do you should use
> c:\vedit\vpw %f -l%l
>
> This is the standard used in compiler interaction.
>

For that special case (only giving the line number) that is easier, correct.

So we can see: there are some exceptions from the rule
"first the options, then the filenames".

From the online help again:


== Each single filename may be followed by one or more of the following
options:
==
== ...
==
== -l nnn Editing of the preceding file will start on line 'nnn'.
== If there are fewer than 'nnn' lines in the file, it will
start at
== the end of the file. You can also specify a numeric
expression
== such as "-l(7890/3)".
==
== Note: When opening just one file, you can also use the following syntax
== to open the file on line 'nnn':
==
== vpw -nnn filename
==
== ...
==



Christian

 


Topic: Re: Question about the Goto_Line( ) command. (12 of 12), Read 71 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Sunday, September 05, 2004 05:53 PM

On 9/4/2004 9:04:15 PM, Ian Binnie wrote:

>>c:\vedit\vpw -c Goto_Line(%l) %f
>
>This works, but if this is all you want
>to do you should use
>c:\vedit\vpw %f -l%l
>
>This is the standard used in compiler
>interaction.
>
>For example for MS VC6.00++ I use:-
>c:\vedit\vpw -cGC($(CurCol))
>"$(FilePath)" -l$(CurLine)
>
>There is a description of how to set
>this up on the Vedit web page.


Thanks Ian,

Glad to see that there is something standard about my Miktex/yap compiler. I understand that I am using the black-sheep of the family. Fritz told me that this is the only compiler that he knows of, which distinguishes between errors and warnings. Of course, for me it is great that I do not have to fix all of my errors, right away; the warnings can wait. I understand that when Fritz wrote latex.vcs, this was not so great for him.

I also would like to see how does Vedit interface with "regular" compilers, like your MS VC++. So, thanks for the info.

I only have some pretty old compilers written for DOS and or Windows 3.1; Borland C version 7
and the MS C++ compiler for windows 3.1 and Turbo Pascal 6.00. Microsoft was also generous and sent me a whole library of books.

The other day I tried to see how these would interface with Vedit. But I was unable to get an error file, or .log file.
I have not looked at the documentation for quite some time.
I take I am missing something very basic. Or, may be I should not even try to run a program under Win/98 which was meant for Win 3.1.



Thanks

-peter.