At 01:23 PM 3/24/2003, you wrote:
>I studied PROJSAVE.VDM a bit. Fascinating!!
(This is an extremely technical discussion.)
You should then also see the very similar veditsav.vdm macro.
>Since I refer to undocumented features I assume they are for internal
>use only. But I'm just interested to know the meaning.
Yes, they are "undocumented". They might change in the future. They are so specialized and limited, that I don't think they are of much value in normal macros.
>1) These two special command variants are not really clear to me:
>
>RCB(0,0,0,EXTRA) // Get buffer dependent config values
This command only works after Save_Env(). Each buffer has about 30
buffer-dependent config parameters plus tab stops. This command places the binary 4-byte values into text register 0.
>Reg_Save(0," ",APPEND) // Save buffer dependent parameters
When opening a project (or restoring an edit-session), the Reg_Load_Part(r,"file",offset,len,LOCAL) command then restores the buffer-dependent values. (Otherwise, each buffer would have needed about 30 Config() commands.)
Following a Save_Env() command the Reg_Save(0,"filename") command keeps the file open. The Reg_Save(r," ",APPEND) commands then appends to end of the still-open file. That is how the .DAT files are built.
>I understand that in the special case
>
> Reg_Load_Part(132,"D:\Vedit\projects\Test2.dat",8694,5,NOERR)
>
> T-Reg 129 is handled as Buffer 1
> T-Reg 130 is handled as Buffer 2
> etc.
>
>So the command loads 5 bytes into (unnamed) buffer 4.
>Is that correct?
Yes. The contents of buffers, which don't have open files, is restored this way.
>And the combination of T-Reg 0 with "LOCAL" means the current buffer's
>parameter block.
Yes, as I said earlier.
>So
> Reg_Load_Part(0,"D:\Vedit\projects\Test2.dat",8699,186,NOERR+LOCAL)
>loads always the 186 special bytes for the current buffer.
Yes. It appears the buffer-dependent parameters, the tab stops and a few other items total 186 bytes. Congratulations, you figured it all out. Unfortunately, there is no prize. ;-)
>Oh no. Another look into a prj file shows at the end:
>
>if(OS_Type==1 && Is_Win32==1 && Version_Num==610) {
>Reg_Load_Part(126,"d:\vedit\projects\remote_edit.dat",45577,640,NOERR)
>} else { Screen_Init(ATTACH) }
>}
No. Register 126 is the window data structure. Since loading an invalid structure will crash VEDIT, we have to carefully check the version number. If the version number doesn't exactly match, we just perform a Screen_Init(). This won't restore custom window positions, but few users would notice it; and it is only applicable when updating to a new version of VEDIT.
Therefore, each new version of VEDIT has a new projsave.vdm and veditsav.vdm macro.
Ted.
|
|