Topic: USB stick and Projects (1 of 35), Read 112 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Wednesday, March 29, 2006 01:53 PM

I installed Vedit on USB memory stick on a computer where the USB stick is mapped as drive E:.

When I try to open any of the projects on another computer, where USB stick is mapped as drive I:, I get an error message:
"DIRECTORY NOT FOUND: E:\vedit\projects"
and the project is not opened.

Further, if I edit files on the USB stick, the file path is stored in the MRU list (in vedit.ini) with drive letter (e.g. E:), and thus can not be opened on another computer. I wonder if it would be possible to save such files in the list without drive letter, like in HOME and MACRO directory setting?

--
Pauli

 


Topic: Re: USB stick and Projects (2 of 35), Read 79 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Wednesday, March 29, 2006 02:44 PM

At 01:54 PM 3/29/2006, you wrote:

>I installed Vedit on USB memory stick on a computer where the USB stick is mapped as drive E:.
>
>When I try to open any of the projects on another computer, where USB stick is mapped as drive I:, I get an error message:
>"DIRECTORY NOT FOUND: E:\vedit\projects"
>and the project is not opened.
>
>Further, if I edit files on the USB stick, the file path is stored in the MRU list (in vedit.ini) with drive letter (e.g. E:), and thus can not be opened on another computer. I wonder if it would be possible to save such files in the list without drive letter, like in HOME and MACRO directory setting?

If someone is working on the computer for an extended time, it is advantageous to have the MRU work as it does. However, as mentioned here, it causes problems when plugging the USB into another computer.

I would like to postpone this for a week or so, but here are some possible solutions:

1. Store the MRU in the computer's registry instead of in vedit.ini.
2. Save a CPU serial number in the vedit.ini and if it doesn't match the current CPU, flush the MRU.

Think about it and lets resume next week.

Ted.

 


Topic: Re: USB stick and Projects (4 of 35), Read 77 times
Conf: VEDIT Beta Test
From: Ian Binnie
Date: Thursday, March 30, 2006 01:58 AM

On 3/29/2006 2:44:56 PM, Ted Green wrote:
>If someone is working on the
>computer for an extended time,
>it is advantageous to have the
>MRU work as it does. However,
>as mentioned here, it causes
>problems when plugging the USB
>into another computer.
>
>I would like to postpone this
>for a week or so, but here are
>some possible solutions:
>
>1. Store the MRU in the
>computer's registry instead of
>in vedit.ini.

For the record I prefer the current practice.
I do not like the use of the registry for local functions, which are only used by one program.

This is more so if I am using Vedit on a foreign computer, where it would leave foreign registry entries.

The only downside of vedit.ini is that the files would not be accessible on another computer.

>2. Save a CPU serial number in
>the vedit.ini and if it
>doesn't match the current CPU,
>flush the MRU.

 


Topic: Re: USB stick and Projects (5 of 35), Read 75 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Thursday, March 30, 2006 03:01 AM

On 3/29/2006 2:44:56 PM, Ted Green wrote:
>
>1. Store the MRU in the computer's registry instead of in vedit.ini.

I don't like the idea of storing data in registry. Registry should not be filled with application data. And messing with registry is asking for problems.

It would be better to store the data in a file on hard disk. The problem is, of course, where this file should be located.

>2. Save a CPU serial number in the vedit.ini and if it
>doesn't match the current CPU, flush the MRU.

Flushing the MRU only makes things worse. At least now you can open some files from the MRU list.

Maybe best solution would be to store MRU entries in two places. The entries that refer to USB stick would be stored in vedit.ini on USB stick, and other would be stored on hard disk.

In order to avoid leaving trash on every computer you visit, this could be configurable. User could have option to do a "mini install" on target computer. This would write one entry in the registry, telling the location of MRU table (or a local vedit.ini file). If this entry is found, it would be used, otherwise the MRU would work as it does now.

Another option would be to include computer ID on every MRU entry, and only show those entries that refer to the current computer.

But in any case, the entries that refer to USB stick should work regardless of the drive letter.

--
Pauli

 


Topic: Re: USB stick and Projects (3 of 35), Read 80 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Wednesday, March 29, 2006 03:04 PM

On Wed, 29 Mar 2006 13:53:00 -0500, Pauli Lindgren wrote:

>I installed Vedit on USB memory stick on a computer where the
>USB stick is mapped as drive E:.
>
>When I try to open any of the projects on another computer,
>where USB stick is mapped as drive I:, I get an error message:
>"DIRECTORY NOT FOUND: E:\vedit\projects"
>and the project is not opened.

That is because PROJSAVE.VDM saves full paths in the .PRJ file.


I did a quick'n'dirty one to make the paths a bit flexible:

In PROJSAVE.VDM, line 584ff:

//
// Cleanup for restoration macro.
//
IT("Return(1,DELETE)") // Discard Project restoring macro
IN()
//------------------------------------------------------
// Added by CZ to handle USB drive changes by replacing
// C:\vedit by |(HOME) in PROJNAME.PRJ
Reg_Set(1, 'Replace("')
Reg_Set(1, HOME, APPEND)
Reg_Set(1, '","|(HOME)", BEGIN+ALL+NOERR)', APPEND)
Call(1)
// end CZ ----------------------------------------------
File_Close(NOMSG+SUPPRESS) // Close PROJNAM.PRJ
Buf_Quit(OK) // Release extra buffer


That "fix" is not perfect. It assumes that the project and macro
directories are in HOME. But it works.

Some future changes in PROJSAVE.VDM could make all paths variable.


Just an idea.


Christian

 


Topic: Re: USB stick and Projects (6 of 35), Read 81 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, April 14, 2006 11:34 AM

I worked on PROJSAVE.VDM again.

This solution is much better now.

First it uses the variable PROJECTS internally instead of writing the path directly to the restoration file:

//
// Setup T-Reg[121] with the project pathname.
//
RS(121,Proj_Current) // i.e., projdriv:\projpath\proj.PRJ
if (RSize(121)==0) { break_out(EXTRA) }

//CZ insert ------------------------------
// Replace hard coded path with variable
Reg_Ins(121, BEGIN)
Replace(PROJECTS,"|(PROJECTS)", NOERR)
RCB(121,0,EOL_POS)
//CZ end----------------------------------

File_Open_Write(@(121),SUPPRESS+FORCE+OVERWRITE)
Begin_Of_File() // Erase any former macro commands
Del_Char(ALL) // Better safe than sorry




And second all remaining hard coded paths of VEDIT's home (if the user was editing a file therein) are replaced by the variable HOME:


// Cleanup for restoration macro.
//
IT("Return(1,DELETE)") // Discard Project restoring macro
IN()
//CZ insert -----------------------------------------
// If there are any open files in Vedit's HOME or below:
// Replace the hardcoded x:\VEDIT by variable HOME
Replace(HOME,"|(HOME)", BEGIN+ALL+NOERR)
//CZ end --------------------------------------------
File_Close(NOMSG+SUPPRESS) // Close PROJNAM.PRJ
Buf_Quit(OK) // Release extra buffer


For easier testing I attached the new version.

Christian


Attachment deleted and uploaded to:
http://www.ziemski.net/vedit/macros/projsav.vdm

 


Topic: Re: USB stick and Projects (7 of 35), Read 73 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Wednesday, April 12, 2006 05:50 AM

On 3/30/2006 3:04:25 AM, Christian Ziemski wrote:
>I worked on PROJSAVE.VDM again.

Thanks, Christian.

I have been testing your modified projsave.vdm with USB stick on two computers. On one computer, the USB stick is drive E:, on another computer it is drive I:.

It seems to work mostly, except that the list of files in each project (in the proj tab of the file selector panel) is empty every time I open the project. If I add files to project, switch to another project and then back to original project, there are no files listed in the project. When I look at the .prj file, there are no Proj_Add() commands.

The open files and other settings are retained, however.

If I remove your modifications, then the project files are retained normally (but can not be used in the other computer).

--
Pauli

 


Topic: Re: USB stick and Projects (8 of 35), Read 72 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Wednesday, April 12, 2006 10:17 AM

On 4/12/2006 5:50:48 AM, Pauli Lindgren wrote:
>
>It seems to work mostly, except that the
>list of files in each project (in the
>proj tab of the file selector panel) is
>empty every time I open the project. If
>I add files to project, switch to
>another project and then back to
>original project, there are no files
>listed in the project.


There seems to be a similar problem with the original projsave.vdm. Or at least I don't understand it's behavior exactly.

Since I don't work with the project tab very often I'll have to test it a bit more now.


Christian

 


Topic: Re: USB stick and Projects (9 of 35), Read 73 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Wednesday, April 12, 2006 10:38 AM

At 10:18 AM 4/12/2006, you wrote:
>There seems to be a similar problem with the original projsave.vdm. Or at least I don't understand it's behavior exactly.
>
>Since I don't work with the project tab very often I'll have to test it a bit more now.

Thank you for your work on projsave.vdm. It has been several years since Tom and I last worked on it and I am a bit rusty myself.

Ted.

 


Topic: Re: USB stick and Projects (10 of 35), Read 77 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Wednesday, April 12, 2006 03:45 PM

On Wed, 12 Apr 2006 10:17:00 -0400, Christian Ziemski wrote:

>On 4/12/2006 5:50:48 AM, Pauli Lindgren wrote:
>>
>>It seems to work mostly, except that the
>>list of files in each project (in the
>>proj tab of the file selector panel) is
>>empty every time I open the project. If
>>I add files to project, switch to
>>another project and then back to
>>original project, there are no files
>>listed in the project.
>
>
>There seems to be a similar problem with the original projsave.vdm.
>Or at least I don't understand it's behavior exactly.

The original is o.k.
I haven't been aware of the difference between files in a project and
files in the project list...


I found the location of the error in my version of projsave.vdm now.
But I'm really puzzled why it doesn't work.
It looks absolutely harmless.

Stay tuned!

Christian

 


Topic: Re: USB stick and Projects (11 of 35), Read 80 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, April 14, 2006 11:35 AM


Hopefully I found a solution now.
At least it's working fine on my PC.

Here are the modified parts of projsav.vdm:
(These comments are still in the attached macro.)


//
// Setup T-Reg[121] with the project pathname.
//
RS(121,Proj_Current) // i.e., projdriv:\projpath\proj.PRJ
if (RSize(121)==0) { break_out(EXTRA) }

//CZ insert ------------------------------
// Replace hard coded path with variable
// This was the first try.
// Unfortunately it doesn't work.
// Somehow the RCB(121,...) destroys the storage of files in the
project list.
// I don't have an idea why.
// Checking @121 before and after the RCB() shows no difference.
// Perhaps a side effect of Save_Env() (Just a wild guess.)
// So I did it another way, see below, line ~603
//Reg_Ins(121, BEGIN)
//Replace(PROJECTS,"|(PROJECTS)", NOERR)
//RCB(121,0,EOL_POS, DELETE)
//CZ end----------------------------------




//
// Cleanup for restoration macro.
//
IT("Return(1,DELETE)") // Discard Project restoring macro
IN()
//CZ insert -----------------------------------------
// Replace the hardcoded project directory with variable PROJECTS
// Replace the hardcoded x:\VEDIT with variable HOME
//
// The obvious syntax fails. It also replaces
// e.g. c:\vedit\projects.txt
// because it didn't check for the trailing backslash:
// Replace(PROJECTS,"|(PROJECTS)", BEGIN+ALL+NOERR)
//
// Fortunately VEDIT 6.15.1 supports the new $(variable) syntax
// so this works:
// (perhaps that would be possible with the older syntax, but how?)
Replace("$(PROJECTS)\","|(PROJECTS)\", BEGIN+ALL+NOERR)
// Same here. E.g. a file C:\vedit.txt
//Replace(HOME,"|(HOME)", BEGIN+ALL+NOERR)
Replace("$(HOME)\","|(HOME)\", BEGIN+ALL+NOERR)
//CZ end -- -----------------------------------------

File_Close(NOMSG+SUPPRESS) // Close PROJNAM.PRJ
Buf_Quit(OK) // Release extra buffer




Christian


Attachment deleted and uploaded to:
http://www.ziemski.net/vedit/macros/projsav.vdm

 


Topic: Re: USB stick and Projects (12 of 35), Read 72 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Thursday, April 13, 2006 10:28 AM

On 4/12/2006 3:37:53 PM, Christian Ziemski wrote:

> // Somehow the RCB(121,...) destroys the storage of files
> in the project list.

Yes, it seems so that the contents of text register 120 is emptied when RCB(121,...) instruction is executed.
(I wonder where does the project file list come to @120 in the first place?)


> // Fortunately VEDIT 6.15.1 supports the new $(variable) syntax
> // so this works:
> // (perhaps that would be possible with the older syntax, but how?)
> Replace("$(PROJECTS)\","|(PROJECTS)\", BEGIN+ALL+NOERR)
> // Same here. E.g. a file C:\vedit.txt
> //Replace(HOME,"|(HOME)", BEGIN+ALL+NOERR)
> Replace("$(HOME)\","|(HOME)\",BEGIN+ALL+NOERR)
>------------------------------

A quick test indicates that this works. But I don't know why.

The pattern $(HOME) now works as |(HOME) should work.
The pattern |(HOME) does not work. Therefore, the resulting commands such as
Proj_Add("|(HOME)\user-mac\C_User.mnu")
should not work.
Or does the old syntax still work in functions other than search/replace?

Anyway, with the "old syntax", you could do the replace using regular expressions, i think.

--
Pauli

 


Topic: Re: USB stick and Projects (13 of 35), Read 75 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Thursday, April 13, 2006 12:30 PM

At 10:28 AM 4/13/2006, you wrote:
>> // Somehow the RCB(121,...) destroys the storage of files
>> in the project list.
>
>Yes, it seems so that the contents of text register 120 is emptied when RCB(121,...) instruction is executed.

Yes, T-reg 120 is documented as:

Internally used text register. It is emptied with each keystroke and by many block commands.

>(I wonder where does the project file list come to @120 in the first place?)

Not sure about that one. Sorry.

Ted.

 


Topic: Re: USB stick and Projects (14 of 35), Read 82 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, April 14, 2006 11:36 AM

On Thu, 13 Apr 2006 00:30:00 -0400, Ted Green wrote:

>At 10:28 AM 4/13/2006, Pauli Lindgren wrote:
>>> // Somehow the RCB(121,...) destroys the storage of files
>>> in the project list.
>>
>>Yes, it seems so that the contents of text register 120 is
>>emptied when RCB(121,...) instruction is executed.
>
>Yes, T-reg 120 is documented as:
>
> Internally used text register. It is emptied with each
> keystroke and by many block commands.

Aaah, yes. Now it's obvious. Thanks for the reminder.


The final macro version is attached.

>>(I wonder where does the project file list come to @120
>> in the first place?)

It is in there when the macro starts.
So it seems to be an internal function, no macro command(s).


Christian


Attachment deleted and uploaded to:
http://www.ziemski.net/vedit/macros/projsav.vdm

 


Topic: Re: USB stick and Projects (16 of 35), Read 82 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Friday, April 14, 2006 08:54 AM

On 4/13/2006 2:24:34 PM, Christian Ziemski wrote:
>
>>>(I wonder where does the project file list come to @120
>>> in the first place?)
>
>It is in there when the macro starts.
>So it seems to be an internal function,
>no macro command(s).

Doesn't sound good. The project file list just happens to be in text register 120. It would really be better if there was a macro function to get the list. Perhaps an internal string value, so that you could use a command such as
Reg_Set(120, PROJ_FILES).

This would be useful in other macros, too. For example, you cold make a macro to perform search among project files (without need to read and parse the .prj file).

--
Pauli

 


Topic: Re: USB stick and Projects (17 of 35), Read 72 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Friday, April 14, 2006 09:14 AM

On 4/12/2006 3:37:53 PM, Christian Ziemski wrote:
>
>Replace("$(HOME)\","|(HOME)\",BEGIN+ALL+NOERR)

I think this $(HOME) is not a "new syntax", but a bug.
After all, pattern matching search is supposed to have only one special character, the pipe character '|'.
The above syntax does not work in older Vedit versions, and it probably won't work in future versions.

The above could be done with regular expressions:
Replace("$(home)\\","|(HOME)\\", BEGIN+ALL+NOERR+REGEXP)

There is another thing that is not yet handled.
The .prj file contains a Chdir() command to set current directory.
If the current directory is set at the USB drive (as it usually is, since at startup it is set to vedit home dir),
then in the other computer I get an error "directory not found".

In addition to that, the project may contain other files on USB drive that are not in vedit home directory. Those files will have wrong drive letter, too.

--
Pauli

 


Topic: Re: USB stick and Projects (18 of 35), Read 72 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Friday, April 14, 2006 10:53 AM

At 09:14 AM 4/14/2006, you wrote:
>From: "Pauli Lindgren"
>
>On 4/12/2006 3:37:53 PM, Christian Ziemski wrote:
>>
>>Replace("$(HOME)\","|(HOME)\",BEGIN+ALL+NOERR)
>
>I think this $(HOME) is not a "new syntax", but a bug.
>After all, pattern matching search is supposed to have only one special character, the pipe character '|'.
>The above syntax does not work in older Vedit versions, and it probably won't work in future versions.

I agree that this is a bug. All Pattern Matching codes are supposed to start with a "|". We will fix this ASAP.

Ted.

 


Topic: Re: USB stick and Projects (32 of 35), Read 29 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Tuesday, September 01, 2009 05:06 AM

On 4/14/2006 10:53:28 AM, Ted Green wrote:
>At 09:14 AM 4/14/2006, you wrote:
>>From: "Pauli Lindgren"
>>
>>I think this $(HOME) is not a "new syntax", but a bug.
>>After all, pattern matching search is supposed to have only one special character, the pipe character '|'.
>>The above syntax does not work in older Vedit versions, and it probably won't work in future versions.
>
>I agree that this is a bug. All Pattern
>Matching codes are supposed to start
>with a "|". We will fix this ASAP.
>
>Ted.

Has this been fixed?
At least on Vedit 6.15.4 (07/02/09) it is still wrong.

For example, makefile typically contains variables such as $(example). Trying to search for these causes an error "bad parameter", unless "simple" search mode is used.

--
Pauli

 


Topic: Re: USB stick and Projects (19 of 35), Read 77 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, April 14, 2006 11:38 AM

On Fri, 14 Apr 2006 09:14:00 -0400, Pauli Lindgren wrote:

>I think this $(HOME) is not a "new syntax", but a bug.
>...
>The above could be done with regular expressions:
>Replace("$(home)\\","|(HOME)\\", BEGIN+ALL+NOERR+REGEXP)

I changed the macros to use the above REGEXP syntax.
That way the macro will work now and after VEDIT is fixed.


>There is another thing that is not yet handled.
>The .prj file contains a Chdir() command to set current directory.
>If the current directory is set at the USB drive (as it usually is,
>since at startup it is set to vedit home dir),
>then in the other computer I get an error "directory not found".

I added a NOERR to Chdir() to avoid the error message...

No real solution I know, but better than an error ;-)


>In addition to that, the project may contain other files on
>USB drive that are not in vedit home directory.
>Those files will have wrong drive letter, too.

Handling that may be a bit more complicated ...



BTW: I'm working on the PROJSAV.VDM without really using the project
feature and without an USB stick.
So I'm not able to test all cases in real world!


Christian


Attachment deleted and uploaded to:
http://www.ziemski.net/vedit/macros/projsav.vdm

 


Topic: Re: USB stick and Projects (20 of 35), Read 78 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, April 14, 2006 11:41 AM

Ooops,

I uploaded/sent a wrong version of veditsav.vdm

So I decided to delete all attachments of my mails in this thread and
uploaded the newest version(s) to my site:

http://www.ziemski.net/vedit/macros/projsave.vdm
http://www.ziemski.net/vedit/macros/veditsav.vdm


Christian

 


Topic: Re: USB stick and Projects (23 of 35), Read 75 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Saturday, April 15, 2006 12:53 PM

There are couple of things that could be fixed now that we are working with projsav.vdm.

First, I noticed that there are lots of comments
"// (Balance next paren..."
in .prj files. These just unnecessarely increase the size of the file (and cause unbalance of parenthesis, too).

There is the following piece of code in projsav.vdm:
//	Free up Text Registers[0-3].
// Set up T-Reg[2] with end-of-command chars: closing parenthesis, newline.
//
Reg_Push(0,3) // Free up text registers 0 - 3
Reg_Set(2,") // (Balance next paren...
") // Reg[2] = end of command chars


I think the comment is not supposed to be included in the text register. I moved it to the previous line, and now the comments are not included in .prj file.

Another thing is how projsav handles the MRU list.

If you open, say, a HTML project that has lots of files open. Then switch e.g. to a C project. Now the MRU list is full of HTML files.
Switch back to HTML project. Now the MRU list is full of C files. Not nice.

I think the MRU option should be removed from the File_Open command. (I haven't yet tested this.)

--
Pauli

 


Topic: Re: USB stick and Projects (25 of 35), Read 76 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Sunday, April 16, 2006 02:03 AM

On Sat, 15 Apr 2006 00:53:00 -0400, Pauli Lindgren wrote:

>First, I noticed that there are lots of comments
>"// (Balance next paren..." in .prj files.
>[...]
>
>I think the comment is not supposed to be included in the text
>register. I moved it to the previous line, and now the comments
>are not included in .prj file.

Good.

(I don't know why they are using that comment. Perhaps only for
checking the balance manually from time to time?)


>Another thing is how projsav handles the MRU list.
>[...]
>I think the MRU option should be removed from the File_Open command.

Sounds reasonable.


Christian

 


Topic: Re: USB stick and Projects (29 of 35), Read 87 times, 1 File Attachment
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Friday, April 21, 2006 09:16 AM

I did a couple of changes to projsave.vdm:

- Moved the comment "(Balance next paren..." to previous line so that it is not included in .prj file.

- Removed MRU from File_Open command.

I have tested this couple of days, and it seems to work ok. The MRU list is now much more useful and the .prj files are smaller.

The updated file is attached.

--
Pauli

 
PROJSAVE.VDM (19KB)

 


Topic: Re: USB stick and Projects (30 of 35), Read 74 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Monday, April 14, 2008 10:19 AM

On 4/21/2006 9:16:14 AM, Pauli Lindgren wrote:
>I did a couple of changes to projsave.vdm:
>
>- Moved the comment "(Balance next paren..." to previous
>line so that it is not included in .prj file.
>
>- Removed MRU from File_Open command.
>
>I have tested this couple of days, and it seems to work ok.
>The MRU list is now much more useful and the .prj files are
>smaller.
>
>The updated file is attached.

I recently noticed that after installing Vedit 6.15.2, the "(Balance next paren..." comments and MRU's have appeared to project files again. So the fix I posted in the above message is not included with Vedit 6.15.2.

--
Pauli

 


Topic: Re: USB stick and Projects (31 of 35), Read 68 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Tuesday, January 13, 2009 02:27 PM

On 4/21/2006 9:16:14 AM, Pauli Lindgren wrote:
>I did a couple of changes to projsave.vdm:
>
>- Moved the comment "(Balance >next paren..." to previous
>line so that it is not included in .prj file.
>
>- Removed MRU from File_Open command.
>
>I have tested this couple of days, and it seems to work ok.
>The MRU list is now much more useful and the .prj files are
>smaller.
>
>The updated file is attached.
>
>--
>Pauli


I merged your modifications with my ones and uploaded the macro to http://www.ziemski.net/vedit/macros/projsave.vdm

Christian

 


Topic: Re: USB stick and Projects (33 of 35), Read 30 times, 1 File Attachment
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Tuesday, September 01, 2009 06:49 AM

On 1/13/2009 2:27:12 PM, Christian Ziemski wrote:
>On 4/21/2006 9:16:14 AM, Pauli Lindgren
>wrote:
>> I did a couple of changes to projsave.vdm:
>>
>> - Moved the comment "(Balance >next paren..." to previous
>> line so that it is not included in .prj file.
>>
>> - Removed MRU from File_Open command.
>
> I merged your modifications with my ones
> and uploaded the macro to
> http://www.ziemski.net/vedit/macros/proj
> save.vdm

The above version has a bug (since the MRU option was removed).
Project save fails with syntax error in case the project contains read-only files.

I already fixed this on January.
I thought I had uploaded the fixed version, but I can not find it here, so here it is again.

I don't know if we should add commands to reset Column_End in case block begin/end are not set. Or has this been fixed in Vedit code? I have not seen this problem for quite a while.

--
Pauli

 
PROJSAVE(1).VDM (19KB)

 


Topic: Re: USB stick and Projects (34 of 35), Read 31 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Tuesday, September 01, 2009 06:59 AM

On 9/1/2009 6:49:29 AM, Pauli Lindgren wrote:
>The above version has a bug (since the
>MRU option was removed).

Sorry, I looked at wrong version. The one pointed by the link already contains the fix.

--
Pauli

 


Topic: Re: USB stick and Projects (35 of 35), Read 34 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Wednesday, September 02, 2009 10:23 AM

At 06:59 AM 9/1/2009, you wrote:
>From: "Pauli Lindgren" (pauli0212@...) On 9/1/2009 6:49:29 AM, Pauli Lindgren wrote:
>>The above version has a bug (since the
>>MRU option was removed).
>
>Sorry, I looked at wrong version. The one pointed by the link already contains the fix.

Sorry that I did not reply while you were figuring this out. I was on a business trip to Canada following up on:

http://www.networkworld.com/news/2009/080609-ibm-brings-us-security-vendor.html

Ted.

 


Topic: Re: USB stick and Projects (21 of 35), Read 78 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Saturday, April 15, 2006 01:06 AM

On Fri, 14 Apr 2006 11:24:00 -0400, I wrote:

>On Fri, 14 Apr 2006 09:14:00 -0400, Pauli Lindgren wrote:
>
>>In addition to that, the project may contain other files on
>>USB drive that are not in vedit home directory.
>>Those files will have wrong drive letter, too.
>
>Handling that may be a bit more complicated ...

The easiest (best?) way to handle this would be a new, not yet
existing, string variable: VEDIT_DRIVE.
Similar to HOME (e.g. C:\VEDIT) it would contain "C:" then.

So PROJSAVE.VDM could do a final
Replace("$(VEDIT_DRIVE)\\","|(VEDIT_DRIVE)\\", REGEXP+BEGIN+ALL+NOERR)
and the above files are handled.


A variable VEDIT_DRIVE may be helpful for other purposes too (esp.
since those USB sticks are possible).

Christian

 


Topic: Re: USB stick and Projects (22 of 35), Read 78 times
Conf: VEDIT Beta Test
From: Pauli Lindgren
Date: Saturday, April 15, 2006 12:40 PM

On 4/15/2006 1:06:27 AM, Christian Ziemski wrote:
>
>The easiest (best?) way to handle this would be a new, not yet
>existing, string variable: VEDIT_DRIVE.
>Similar to HOME (e.g. C:\VEDIT) it would contain "C:" then.

Yes, that would be useful.
As it is now, it would be possible to find out the drive letter by taking first 2 characters from HOME string. But it is quite complex thing to do, requiring to use tmp buffer.

I have often thought that it would be nice to have some string handling functions for text registers, so that you would not need to use buffers all the time. Even the possibility to use substrings would be helpful.

For example the following command:
Reg_Set(1, @(2,5,10))
would copy characters 5 to 10 from text register 2 into text register 1.

Vedit drive letter could be fetched with syntax |(HOME,1,2)

--
Pauli

 


Topic: Re: USB stick and Projects (24 of 35), Read 77 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Sunday, April 16, 2006 01:50 AM

On Sat, 15 Apr 2006 00:40:00 -0400, Pauli Lindgren wrote:

>On 4/15/2006 1:06:27 AM, Christian Ziemski wrote:
>>
>>The easiest (best?) way to handle this would be a new, not yet
>>existing, string variable: VEDIT_DRIVE.
>>Similar to HOME (e.g. C:\VEDIT) it would contain "C:" then.
>
>Yes, that would be useful.
>As it is now, it would be possible to find out the drive letter by
>taking first 2 characters from HOME string. But it is quite
>complex thing to do, requiring to use tmp buffer.

... and you would have to store it somehow in the project file and
recalculate and set it on the next open of that project. Not nice.
VEDIT_DRIVE would be much easier.


>I have often thought that it would be nice to have some string
>handling functions for text registers, so that you would not need
>to use buffers all the time.

Me too.

As far as I remember Ted wrote something about technical restrictions
regarding text register operations, ar least when modifying registers.


>Even the possibility to use substrings would be helpful.

>For example the following command:
>Reg_Set(1, @(2,5,10))
>would copy characters 5 to 10 from text register 2 into text register 1.

Such a function would be wonderful, indeed.


Christian

 


Topic: Re: USB stick and Projects (28 of 35), Read 81 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Tuesday, April 18, 2006 11:34 AM

On Sun, 16 Apr 2006 01:50:00 -0400, I wrote:

>On Sat, 15 Apr 2006 00:40:00 -0400, Pauli Lindgren wrote:
>
>>On 4/15/2006 1:06:27 AM, Christian Ziemski wrote:
>>>
>>>The easiest (best?) way to handle this would be a new, not yet
>>>existing, string variable: VEDIT_DRIVE.
>>>Similar to HOME (e.g. C:\VEDIT) it would contain "C:" then.
>>
>>Yes, that would be useful.
>>As it is now, it would be possible to find out the drive letter by
>>taking first 2 characters from HOME string. But it is quite
>>complex thing to do, requiring to use tmp buffer.
>
>... and you would have to store it somehow in the project file and
>recalculate and set it on the next open of that project. Not nice.
>VEDIT_DRIVE would be much easier.

Ted:

I have an idea how to solve the problem with that drive letter in the
current PROJSAVE.VDM.

But I don't want to spend too much time in implementing it manually
when my suggested VEDIT_DRIVE may be realized in near future.

Please let us know what you think about it.


Christian

 


Topic: Re: USB stick and Projects (26 of 35), Read 78 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Sunday, April 16, 2006 11:36 AM

At 12:41 PM 4/15/2006, you wrote:

>For example the following command:
>Reg_Set(1, @(2,5,10))
>would copy characters 5 to 10 from text register 2 into text register 1.

You can do this with:

Outreg(1); Reg_Type_Block(2,5,10); Outreg(Clear)

The counting starts from 0, so the command to output the first two chars of T-Reg 9 would be Reg_Type_Block(9,0,2)

I agree that better substring operations would be nice. :-)

Ted.

 


Topic: Re: USB stick and Projects (27 of 35), Read 85 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Sunday, April 16, 2006 02:03 PM

On Sun, 16 Apr 2006 11:36:00 -0400, Ted Green wrote:

>>Reg_Set(1, @(2,5,10))
>>would copy characters 5 to 10 from text register 2 into text
>>register 1.
>
>You can do this with:
>
>Outreg(1); Reg_Type_Block(2,5,10); Outreg(Clear)

Wow!
Thanks for the tip.

I learned something new here. :-)


Christian

 


Topic: Search path for macros (15 of 35), Read 66 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Thursday, April 13, 2006 03:12 PM


While working on PROJSAV.VDM and VEDITSAV.VDM I often had the problem
that VEDIT ignored my macro version in USER_MACRO and executed the one
in the main MACRO directory.
I had to rename/delete or replace the one in MACRO to make my own
version run. (I earlier had this problem but ignored it then.)

That seems to be dependent on the files open in VEDIT and/or the
current directory.

That is a real problem IMHO!!!

As far as I understand it the search path for macros is
1.) current dir
2.) USER_MACRO
3.) MACRO

I think the problem above arises when Cur-DIR already is MACRO.


Perhaps it better should be

if (Cur_Dir == MACRO) OR (Cur_Dir == USER_MACRO)
1.) USER_MACRO
2.) MACRO
else
1.) current dir
2.) USER_MACRO
3.) MACRO


What do you think?


Christian