Loading ...
Sorry, an error occurred while loading the content.
 

[NTB] Re: Using clips to launch javac.exe to compile .java files

Expand Messages
  • MKT Song
    Hello Jody, Sami and Larry, Thanks for the suggestions and pointers. The batch file thingi should work just fine for what I am doing. Regards, Terence ... MKT
    Message 1 of 10 , Dec 2, 1998
      Hello Jody, Sami and Larry,

      Thanks for the suggestions and pointers. The batch file thingi should work
      just fine for what I am doing.

      Regards,
      Terence
      ----------------------
      MKT Song
      Centre for Communications Research
      University of Bristol
      Terence.Song@...

      On Tue, 1 Dec 1998, Jody wrote:

      > Hi Larry, Sami, and Terrence,
      >
      > >>There is an option in some Dos windows to "Close on Exit."
      >
      > >Can you expand on that? I'm sorry but I have no idea what you're
      > >talking about =)
      >
      > Terrence originally asked the question of how to keep the Dos window
      > open after doing his JAVA thing at which time you suggested a .bat
      > file. I was mentioning the "Close on Exit" along with some other
      > stuff. Terrence says he doesn't see it on Win98, but did on 95.
      >
      > Anyhow, thatnks Larry - you answer helped me out and looks like it
      > should for Terrence as well. :)
      >
      > >^!CmdShow Minimize
      > >^!Command.com /c Mybatch.bat
      >
      > >Will run the named batch file minimized on the task bar and quit
      > >DOS when finished.
      >
      > >^!CmdShow Minimize
      > >^!command.com /k Mybatch.bat
      >
      > >Will run the named batch file minimized on the task bar but will
      > >leave DOS active when finished. You can get to the DOS window by
      > >clicking on the task bar button. If you do not use the CmdShow
      > >command, the DOS box will appear or a full-screen DOS window if
      > >that is how you quit it the last time you used DOS.
      >
      >
      > c ya,
      > Jody Adair
      > Prov. 3:5-7; 4:23
      >
      > http://www.mindspring.com/~kjb1611
      > ------------------------------------------------------------------------
      > Free Web-based e-mail groups -- http://www.eGroups.com
      >
      >

      ------------------------------------------------------------------------
      Free Web-based e-mail groups -- http://www.eGroups.com
    • MKT Song
      Hi Larry and Sami, I have written the batch file and clip as you suggested. Here they are. The batch file: @echo off if exist %1.class del %1.class javac
      Message 2 of 10 , Dec 2, 1998
        Hi Larry and Sami,

        I have written the batch file and clip as you suggested. Here they are.

        The batch file:

        @echo off
        if exist %1.class del %1.class
        javac %1.java
        pause

        if exist %1.class goto run
        it not exist %1.class goto stop

        :run
        java %1
        pause

        :stop

        And here is the clip:

        ^!Set %JFullFilePathWithExt%="^**"
        ^!Set %FileNameWithExt%=^$StrDelete(^%JFullFilePathWithExt%;1;46)$
        ^!Set %FileNameSize%=^$StrSize(^%FileNameWithExt%)$
        ^!Set %DotIndex%=^$[^%FileNameSize% - 4;0]
        ^!Set %FileNameNoExt%=^$StrDelete(^%FileNameWithExt%;^%DotIndex%;5)$

        ^!CmdShow Normal
        ^!Prompt ^%FileNameNoExt%

        ^!Command.com /c jcr.bat ^%FileNameNoExt%

        I had to do a few things in the clip to get rid of the full path,
        otherwise, the batch file would only get part of the path (The path in
        %1 would be delimited by the first space character encountered).

        Though the clip and batch file works, there is a limitation. Using the
        current clip, I cannot pass command line arguments to my java program when
        I run it (through the "java" interpreter). How do I prompt for text fields
        from the user and then enter the contents of the text fields into
        variables when I run the clip.

        Your suggestions are very much welcomed. Many thanks.

        Regards,
        Terence
        ----------------------
        MKT Song
        Centre for Communications Research
        University of Bristol
        Terence.Song@...

        On Tue, 1 Dec 1998, Lawrence R. Thomas wrote:

        > Hi Jody,
        >
        > At 10:27 AM 12/1/98 -0600, you wrote:
        > >Hi Terrence and Sami,
        > >
        > >>>> ^$GetOutput("Param")$
        > >
        > >>You could make a batch file which executes javac.exe and
        > >>redirects output to a file, then you could read that file
        > >>in NoteTab. This is what I do in my JavaClips, a perhaps-
        > >>soon-to-be-released clip library for Java programmers.
        > >
        > >There is an option in some Dos windows to "Close on Exit."
        > >I have no clue how to get to the window that comes up, but
        > >possibly that could be unchecked if checked??? I tried to
        > >find the one that FTP.exe uses at one time to run in
        > >minimized, but had no luck.
        > >
        > >Happy NoteTabbin',
        > >Jody Adair
        >
        > You can use the /c and /k switched with command.com as follows:
        >
        > ^!CmdShow Minimize
        > ^!Command.com /c Mybatch.bat
        >
        > Will run the named batch file minimized on the task bar and quit DOS when
        > finished.
        >
        > ^!CmdShow Minimize
        > ^!command.com /k Mybatch.bat
        >
        > Will run the named batch file minimized on the task bar but will leave DOS
        > active when finished. You can get to the DOS window by clicking on the
        > task bar button. If you do not use the CmdShow command, the DOS box will
        > appear or a full-screen DOS window if that is how you quit it the last time
        > you used DOS.
        >
        > Regards,
        >
        > Larry Thomas
        > larryt@...
        > ------------------------------------------------------------------------
        > Free Web-based e-mail groups -- http://www.eGroups.com
        >
        >

        ------------------------------------------------------------------------
        Free Web-based e-mail groups -- http://www.eGroups.com
      Your message has been successfully submitted and would be delivered to recipients shortly.