// CMD-LINE.VDM Date: 05/20/2004 // // Simple macro to output assorted information regarding command line // options. The output file "CMD-LINE.TXT" is saved to 'user-mac' dir // // Syntax: vedit|vpw -q -x cmd-line -a // // NOTES: Requires the 5-20-2004 revision of Vedit 6.12.1 or greater to // use with DOS Vedit (reg_save() command) and given size limits on a T-Reg // this will have to be modified to use an edit buffer if much more info is // added to the output. // // The Starving Hedonist - http://cu2.home.comcast.net // // Put Sub-routine in Text Register 101 Reg_Set(101,% :DIVIDER: Tab_Out(2) Type_Char(61,COUNT,2) Type_Space(2) Return %) Out_Reg(99) // STRINGS Reg_Set(99,"-||||| STRINGS |||||-") Type_Newline(2) Reg_Set(99,"PATHNAME",APPEND) Call(101,"DIVIDER") Reg_Set(99,PATHNAME,APPEND) Type_Newline(1) // PATHNAME Full pathname of the current output (write) file Reg_Set(99,"PATH_ONLY",APPEND) Call(101,"DIVIDER") Reg_Set(99,PATH_ONLY,APPEND) Type_Newline(1) // PATH_ONLY Just the path (directory) of the current file Reg_Set(99,"FILENAME",APPEND) Call(101,"DIVIDER") Reg_Set(99,FILENAME,APPEND) Type_Newline(1) // FILENAME Just the filename of the output file Reg_Set(99,"FILE_ONLY",APPEND) Call(101,"DIVIDER") Reg_Set(99,FILE_ONLY,APPEND) Type_Newline(1) // FILE_ONLY Just the filename without the extension Reg_Set(99,"FILE_EXT",APPEND) Call(101,"DIVIDER") Reg_Set(99,FILE_EXT,APPEND) Type_Newline(1) // FILE_EXT Just the filename extension with the "." (period) Reg_Set(99,"EXT_ONLY",APPEND) Call(101,"DIVIDER") Reg_Set(99,EXT_ONLY,APPEND) Type_Newline(1) // EXT_ONLY Just the filename extension without the "." (period) Reg_Set(99,"INPUT_FILE",APPEND) Call(101,"DIVIDER") Reg_Set(99,INPUT_FILE,APPEND) Type_Newline(1) // INPUT_FILE Full pathname of the current input (read) file Reg_Set(99,"CMD_LINE",APPEND) Call(101,"DIVIDER") Reg_Set(99,CMD_LINE,APPEND) Type_Newline(2) // CMD_LINE // COMMANDS Reg_Set(99,"-||||| COMMANDS |||||-",APPEND) Type_Newline(2) Reg_Set(99,"Name_File()",APPEND) Call(101,"DIVIDER") Name_File // Name_File( ) Display names of the input and output files Reg_Set(99,"Name_File(EXTRA)",APPEND) Call(101,"DIVIDER") Name_File(EXTRA) // Name_File(EXTRA) Display filenames with complete drive and path Reg_Set(99,"Name_Read()",APPEND) Call(101,"DIVIDER") Name_Read // Name_Read( ) Display name of the input (read) file Reg_Set(99,"Name_Read(EXTRA)",APPEND) Call(101,"DIVIDER") Name_Read(EXTRA) // Name_Read(EXTRA) Display filename with its drive and path Reg_Set(99,"Name_Write()",APPEND) Call(101,"DIVIDER") Name_Write // Name_Read(NOMSG) Omit the "Input file:" header // Name_Read(NOCR) Omit the following CR+LF newline Reg_Set(99,"Name_Write(EXTRA)",APPEND) Call(101,"DIVIDER") Name_Write(EXTRA) // Name_Write( ) Display name of the output (write) file Type_Char(45,COUNT,40) Type_Newline(2) Out_Reg(CLEAR) if (Version_Num >= 612) { Reg_Save(99,"|(USER_MACRO)\CMD-LINE.TXT",OK|APPEND|NOERR) } else { // pre 6.12 Buf_Switch(Buf_Free()) File_Open("|(USER_MACRO)\CMD-LINE.TXT",NOEVENT|NOMSG|OVERWRITE) EOF Ins_Text(@99) Buf_Close(NOMSG|NOEVENT) } Return(1,DELETE)