// C-JAVAVM.VDM - Run Java Virtual Machine (JVM). // Originally written by Alan G. Herron. // Modified by: Christian Ziemski, April, 2001 // Last Change: 25-Apr-01. // Call_File(103,"|(HOME)/compile/c-init.vdm") //Common Init. if (Return_Value==-1) { Return } if (Return_Value==-2) { #68=0 Chain(#69) } // // Allow user to enter optional parameters // if (#123==1) { //If 2nd menu entry... if (OS_Type == 1) { if (DI1(95,"`Executing Java-VM`, `Enter optional parameters: `, `??`, `[OK]`, `[Cancel]`", APP+CENTER,0,0) != 1) { Reg_Empty(95) // CZ 25-Apr-2001 #68=0 // [Cancel] now cancels the J-VM execution Chain(#69) // and not only the dialog box } } else { Get_Input(95,"Enter optional parameters for the Java-VM call: ", STATLINE+NOCR) } Reg_Set(95," ",INSERT) Reg_Set(95,@87, INSERT) //@95 = JavaVM command with options } else { Reg_Set(95,@87) //@95 = JavaVM command } Buf_Switch(33) Buf_Empty(OK) //Empty temp buffer $33 Reg_Ins(87) //Load JavaVM command Win_Delete('E') Call(103,"ADD_PROJECT") //Expand command in @95 //Delete any vcs.tmp file Win_Vert(Win_Lines-1) //Position cursor Message("Java Development Kit(tm) Virtual Machine Support\n") Reg_Type(95) //Say what is happening if (OS_Type > 4) { //If QNX... #78 = System("|@(95) 2>&1 | tee |@(96)/vcs.tmp",NOMSG+LOCAL) //Split output to file & screen } else { if (OS_Type==1) { //If Windows... if (Is_WinNT) { Reg_Set(98," > vcs.tmp 2>&1") //Reroute stdout and stderr to vcs.tmp } else { Reg_Set(98," > vcs.tmp") //Reroute stdout to vcs.tmp } Call(103,"MAKE-BAT") //Create VCS-TMP.BAT file System("|@(96)\vcs-tmp.bat",DOS+SIMPLE+NOMSG+LOCAL) //Perform command in .BAT file #78=0 //No return value from .BAT file } else { #78 = System("|@(95) > |@(96)\vcs.tmp",NOMSG+LOCAL) //Perform DOS command } } // // Open the vcs.tmp file; give error and quit if none found. // Call(103,"OPEN-VCS.TMP") //Open vcs.tmp file in buffer $34 if (Return_Value==-1) { //If no output file... #68=0 Chain(#69) //Quit and return } // new version (from 24-Apr-2001 on) CZ Call(103,"DISPLAY-OUTPUT") // !!! Crash! // !!! If you uncomment the return here (what is logical wrong, but was my first try) // !!! and then have a JavaVM output to be viewed you can crash VEDIT: // !!! Just answer on the question displayed by DISPLAY-OUTPUT // !!! 'Press "V" to view output; any other key to continue:' // !!! with a character other than 'V' and then a second key => BANG // return #68=0 Chain(#69) // old version (up to 24-Apr-2001) // // Display VM output. // //#99=0x4A415641 //#99="JAVA" //Chain_File(Macro_Num,"|(HOME)/compile/c-compil.vdm") // Java mod ////Chain(#69) // useless