Topic: Read One Line, Put in text register (1 of 3), Read 110 times
Conf: VEDIT Macro Language Support
From: Clint Danbury
Date: Friday, May 12, 2000 12:37 AM

How do I stick one line of a file into a text register ?




---------------------------Complete Details--------------------------



I want to prepare a list of files, then read from that list, and then
make some decisions and so on.

My skill level will be evident within 90 seconds, so don't feel as if
you need to insult me; I'm well aware of where I fall on the curve:-)

Anyway, I want to do a not-so-involved set of operations on a list of
files (well, "file names" might be more proper) that I will create as
I need them. The list of file names will look like this...

SomeFile.Txt
SomeFile.Asm
SomeFile.Equ
|
|---------------------------------(like, a zillion of these)
|
Another.File.Name.Obj
Another.File.Name.Inc
Another.File.Name.Etc


More to the specific point here, how do I put the name "Somefile.Txt"
into a text register (I am thinking 20) so that I can open it for use
in another buffer ?

I looked in the manuals and the PDF files for every phrase that might
be close, but found nothing. Reg_Set looked close, but evidently it's
not really correct. This can't be that complicated. Any suggestions ?


When I examined the "Wildfile.VDM" example, the closest thing I could
find was this...


File_Open('"|@(#95)"')


I did not immediately see how the "95" stuff was actually formed with
the name of a given file.



The following way does not work,

File_Open_Read("The_Prepared_List")

While (! At_EOF)

{
@20 = File_Read() <<---------------------- Vedit gets mad here
Buf_Switch()
File_Open(@20)
|
|
|
|
|
| <<-------------------- My stuff will go down here
|
|
|
|
}




 


Topic: Read One Line, Put in text register (2 of 3), Read 123 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Friday, May 12, 2000 02:30 AM

Hello Clint,

maybe this is what you want:



Buf_Switch(1) // buffer for the list of files
File_Open("the_list")

while(! AT_EoF){
Reg_Copy(20,1) // get one line

Buf_Switch(2) // working buffer for the list's files
File_Open('"|@(20)"') // open the one file here

Update // \
Get_Key("Press Key") // do your stuff here
// File_Save() // /
Buf_Quit(OK)

Buf_Switch(1) // go to the list again
Line(1,NOERR) // and prepare for the next cycle (if any)
}



HTH

Christian

 


Topic: Read One Line, Put in text register (3 of 3), Read 130 times
Conf: VEDIT Macro Language Support
From: Clint Danbury
Date: Saturday, May 13, 2000 12:08 PM

What is going on here ?

Your two suggested lines worked fine....


--------------- Start ---------------------

Buf_Switch(2) // working buffer for the list's files
File_Open('"|@(20)"') // open the one file here

--------------- Stop ---------------------


...fine until I exited vedit, changed to a different sub-directory and
then ran my macro again. The File_Open stuff believes that I am in the
other sub-directory.

Something like this...

[At the Dos Command Line]

CD \XYZ\My_Test\Silly_Files
Vedit
|
|
|------------(test my stuff; hooray it works; exit vedit)
|
|
|

CD \UVW\Real_Stuff\Real_Files
Vedit
|
|
|------------(Same Macro that just worked)
|
|
|
Error message telling me...

Cannot find \XYZ\My_Test\Silly_Files\The_List


Further investigation reveals that this behavior is not limited to the
macro which I'm asking vedit to invoke, but it's now a consistent part
of the file opening process; i.e., Vedit is now expecting the files to
be located in the (evidently; as I am going on pure guesses here) same
sub-directory as the previously opened files.

... i.e.,

Even when I'm in visual mode, (File, Open, New Buffer, Etc.)
the file open box automatically puts the old path in the field holding
the filename.

BOING !

I'll bet I configured something somewhere that's doing this to me, but
exactly what that was, well, duh.