$! ...................... Cut between dotted lines and save. ..................... $!............................................................................. $! VAX/VMS archive file created by VMS_SHARE V06.03 20-Oct-1988. $! $! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from $! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au). $! $! To unpack, simply save, concatinate all parts into one file and $! execute (@) that file. $! $! This archive was created by user SHEETS $! on 19-NOV-1990 15:12:22.81. $! $! It contains the following 4 files: $! COMP_AND_LINK.COM $! SHARE.OPT $! VTEST.COM $! VMENU.C $! $!============================================================================== $ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL ) $ VERSION = F$GETSYI( "VERSION" ) $ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK $ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", - "VMS_SHARE V06.03 20-Oct-1988 requires VMS V4.4 or higher." $ EXIT 44 $VERSION_OK: $ GOTO START $ $UNPACK_FILE: $ WRITE SYS$OUTPUT "Creating ''FILE_IS'" $ DEFINE/USER_MODE SYS$OUTPUT NL: $ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION - VMS_SHARE_DUMMY.DUMMY b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) ); s_file_spec := GET_INFO( COMMAND_LINE, "output_file" );SET( OUTPUT_FILE, b_part , s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" );i_errors := 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; pat_trail := " " & LINE_END;POSITION( BEGINNING_OF( b_part ) ); LOOP b := SEARCH( pat_trail, FORWARD); EXITIF b=0; POSITION( END_OF( b ) ) ; LOOP MOVE_HORIZONTAL( -1 ); EXITIF CURRENT_CHARACTER <> ' '; ERASE_CHARACTER ( 1 ); EXITIF CURRENT_OFFSET=0; ENDLOOP; ENDLOOP; POSITION( BEGINNING_OF ( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE ) = END_OF( b_part ) ; s_x := ERASE_CHARACTER( 1 ); IF s_x = "+" THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip < > 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF; IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip < > 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE ) ; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION ( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 ) ; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE ( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF; IF s_x = "V" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL ( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = "X" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL ( -CURRENT_OFFSET ); ENDIF; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> "" THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION ( b_errors ); COPY_TEXT( "The following line could not be unpacked properly:" ) ; SPLIT_LINE; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ) ; MOVE_VERTICAL( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ) ; ERASE_CHARACTER( 1 ); IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII ( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET ( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS" , i_errors, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" );ENDIF; EXIT; $ DELETE VMS_SHARE_DUMMY.DUMMY;* $ CHECKSUM 'FILE_IS $ WRITE SYS$OUTPUT " CHECKSUM ", - F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." ) $ RETURN $ $START: $ FILE_IS = "COMP_AND_LINK.COM" $ CHECKSUM_IS = 388455658 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$Set Ver X$CC Vmenu X$Link vmenu,share.opt/opt X$Set Nover $ GOSUB UNPACK_FILE $ FILE_IS = "SHARE.OPT" $ CHECKSUM_IS = 1177693836 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY XSYS$SHARE:VAXCRTL.EXE /SHARE $ GOSUB UNPACK_FILE $ FILE_IS = "VTEST.COM" $ CHECKSUM_IS = 1816679588 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$VMenu :== $TOOLS_BIN:Vmenu.exe X$! Arg 1 is a DCL Symbol X$! Arg 2 is the row `032 X$! Arg 3 is the column `032 X$! Arg 4 is the optional menu width (If 0, it is calculated) X$! Arg 5 is the optional menu title (If no title is desired, put "") X$! Arg 6 - .... are the menu items X$MAINMENU: X$ Define/nolog sys$input sys$command X$ VMenu M$C 7 30 0 - X "A big title line" -`032 X "1. User disk" - X "2. system disk" - X "3. exit" - X "1. User disk" - X "system disk" - X "exit" `032 X$ If M$C .eqs. "1" then write sys$output "1" X$ If M$C .eqs. "2" then write sys$output "2" X$ If M$C .eqs. "6" Then Exit X$ Read /prompt="Press return to continue...." sys$input temp X$ Goto MainMenu X$! X$ exit $ GOSUB UNPACK_FILE $ FILE_IS = "VMENU.C" $ CHECKSUM_IS = 454779754 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* V* `032 X `032 V* This software was developed using the resources of the Inland Steel Research X`032 V* Laboratories. It is available for unlimited distribution in the public `032 X `032 V* domain with the inclusion of this notice. `032 X `032 X* X**++ X** FACILITY: X** X** Vmenu.C X** X** ABSTRACT: X** X** Function which creates a vertical menu`032 X** Pastes it anywhere on the screen`032 X** Makes a selection thru arrow keys or 1st Letter X** And places the Selection in the passed parameter X** Screen refreshes with Control R or Control W X** AUTHOR: X** X** Dean Sheets - Inland Steel Research Laboratories Sheets@Inland.Com X** 219-399-8043 X** X** CREATION DATE: 8/2/89 X** X** PARAMETERS: X** argc == Total # of command line parameters X** argv == Array of Menu Items X** argv[0] == Holds name the program was invoked by X** argv[1] choice == Holds number of Selection Chosen X** argv[2] row == Starting Row X** argv[3] col == Starting Col X** argv[4] menu.width == Holds menu.width of Menu if desired X** argv[5] menu.title == Menu Title X** argv[6-num.items+6] == Menu items X** X** MODIFICATION HISTORY: X**-- X** X** INCLUDE FILES X** X**/ X#include smgdef X#include string X#include stdio X#include ssdef X#include descrip X Xmain(int argc, char *argv[]) X X `123 long mrow=0,row=0,col=0,num_items=0,width=0,height=0; X long choicerow=0,choicelen=0; X int keystroke=0,choice=0,startchoice=0,cnt=0; X unsigned keyboard_id, display_id, pull_down; X char schoice[2], linetext[80], symtext[80], lchoicetext[10], *pml; X X /* Set up descriptors for text strings */ X $DESCRIPTOR(menu_line,linetext); X $DESCRIPTOR(symbol,symtext); X $DESCRIPTOR(lchoice,lchoicetext); X X /* Get the value of the symbol they passed */ X symbol.dsc$w_length = strlen(argv[1]); X strncpy(symtext, argv[1], strlen(argv[1])); X LIB$GET_SYMBOL(&symbol, &symbol); X X /* Convert selected pointer array parameters */ X sscanf(symtext, "%d", &choice); X sscanf(argv[2], "%d", &row); X sscanf(argv[3], "%d", &col); X sscanf(argv[4], "%d", &width); X num_items = argc; X height = (argc - 6); X X /* Find the Max Length of a Menu Item */ X for (cnt=6; cnt width) width = strlen(linetext); X `125 X X /* Make sure the Title will fit */ X strncpy(linetext, argv[5], 80); X menu_line.dsc$w_length = strlen(argv[5]); X if ((menu_line.dsc$w_length > width)) width = menu_line.dsc$w_length; X width += 2; X X SMG$CREATE_VIRTUAL_DISPLAY(&height, &width, &display_id, &SMG$M_BORDER); X SMG$CREATE_PASTEBOARD(&pull_down); X X /* Label the Border if a Title was Passed */ X SMG$LABEL_BORDER(&display_id, &menu_line, &SMG$K_TOP, 0, &SMG$M_BOLD); X X for (cnt=6; cnt 0); /* delete it */ X s[cnt] = '\0'; X reverse(s); X`125 X X/* Reverse a char array */ Xreverse(char s[]) X`123 X int c,i,j; X X for (i = 0, j = strlen(s)-1; i < j; i++, j--) X `123 c = s[i]; X s[i] = s[j]; X s[j] = c; X `125 X`125 $ GOSUB UNPACK_FILE $ EXIT