Hi, I made some additions and came up with this. I read about text
register use and am not quite clear if I ought to be using 103-106
or 10-90 or if it really matters in this case.
I modify the DOS version string by adding "(DOS)" to it. The way I
was wanting to determine that the string came from vedit.exe was to
check the VEDIT_EXE for VEDIT.EXE but I had already worked out the
way shown below and got frustrated trying to parse a T-Reg for a
substring.
Anyhow, the macro is something which I am bothering with so that I
don't have to remember to include the proper information in case of
a support related email. I use The Bat! for email and I will be
complementing this macro with a plug-in for TB! that will read and
insert the version/date/sn info to email messages as needed. If
anyone is using TB! and would like a reply template for WebBoard or
is interested in the other widgets I've made, they can be found at
my little webpage: http://cu2.home.comcast.net
----------8<-------------------
// Macro to output version & serial number information of vpw[64].exe
// and vedit.exe to a text file with windows INI file structure.
//
// syntax: vedit|vpw[64] [-g] -q -x ve-ver
//
// The "-g" parm is used simply to bypass the errors / block to run
// this macro with a DOS-WINDOWS shared installation of VPW 6.12 &
// VEDIT 6.11
//
// Output file is 8.3 named to maintain functionality with VEDIT-DOS
Reg_Set(10, "VEDIT") // store in text register 10
Out_Reg(11) // redirect output to text register 11
Version() // output vedit version & build date
Out_Reg(CLEAR) // end output redirection
// Use v6.12 specific command if possible avoiding BAK creation
if (Version_Num >= 612) {
File_Open_Write("VED-VER.INI", OVERWRITE)
} else {
Buf_Switch(Buf_Free(EXTRA))
}
// assemble and add "[VEDIT]" section string then add
// "Version=" section item and value
Ins_Text("[")
Ins_Text(@10)
Ins_Text("]")
Ins_Newline(1)
Ins_Text("Version=")
Ins_Text(@11)
BOF // jump to begining of buffer for search
Search("|@(10)|B", ADVANCE) // search for "VEDIT "
if (Match("V")==0) { // if Version() output changes
Ins_Text("(DOS) ") // this will need fixing --
} // haven't figured out how to
// parse VEDIT_EXE string
EOF // jump to end to add "SN=" section item
Ins_Text("SN=")
// check for VEDIT.INI in user area assume home if not found
if (File_Exist("|(USER_CFG)\|@(10).INI")) {
Reg_Set(12, USER_CFG)
} else {
Reg_Set(12, HOME)
}
Reg_Set(12, "\", APPEND) // assemble VEDIT.INI filespec
Reg_Set(12, @10, APPEND) // store in text reg 12
Reg_Set(12, ".INI", APPEND)
#10=Buf_Num // store working buffer num
File_Open("|@(12)", BROWSE) // before opening file/buffer
Search("|
if (Match("|D|D|D|D|D")==0) { // locate SN item and store value
Reg_Copy(13, 1) // to text register 13
} else {
Reg_Set(13, "NONE")
}
File_Quit(OK) // close VEDIT.INI and return to work buffer
Buf_Switch(#10)
Ins_Text(@13) // add the serial number to "SN=" item
// save avoiding creation of BAK file for pre v6.12
if (Version_Num < 612) {
#10 = Config(F_BACKUP_MODE, 0)// save existing value then turn off
File_Save_As("VED-VER.INI", NOMSG+OK)
Config(F_BACKUP_MODE, #10) // restore original value
}
----------8<-------------------
Comments and suggestions welcome!
--
John
|
|