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

Java Clip

Expand Messages
  • Clint Tredway
    Doesn t some one have a clip for compiling and running java code from Note Tab? Clint
    Message 1 of 2 , Jan 26, 2001
    • 0 Attachment
      Doesn't some one have a clip for compiling and running java code from Note
      Tab?

      Clint
    • Larry Hamilton
      Clint, I saw your post, and have just been too busy to dig out a couple of clips from Wayne (now I have some time). I find they are very helpful. At the end
      Message 2 of 2 , Feb 2, 2001
      • 0 Attachment
        Clint,

        I saw your post, and have just been too busy to dig out a couple of
        clips from Wayne (now I have some time). I find they are very
        helpful. At the end are some
        of my own creations. I have not had time to work with Java for a
        long time, just playing mostly, so I cannot offer a lot of help with it.

        I did learn how to do some things with other programming
        languages, from these clips, that are fairly portable, but again,
        mostly playing.

        H="Compile Java"
        ;Wayne VanWeerthuizen <wayne@...>
        ;Tue, 28 Dec 1999 23:13:55 -0800
        ;This clip requires sun's compiler, called 'javac', to be
        ;located at "C:\jdk\bin\javac.exe" If your copy of javac is stored
        ;elsewhere, you'll need to modify the path in the clip.
        ;// Get rid of old error file, so we don't get misled by seeing it
        around
        ^!SET %ErrorFile%=^$GetStdErrorName$
        ^!DestroyDoc ^%ErrorFile%
        ;// Make sure source code is saved
        ^!Save
        ^!Set %File%=^**
        ;// Prepare a place to put the command's output
        ^!Set %DocIndex%=^$GetDocIndex$
        ^!Toolbar "New Document"
        ;// Compile the java applet
        ;^!InsertText ^$GetOutput("C:\JDK\BIN\JAVAC -deprecation"
        "^%File%")$
        ;^!InsertText ^$GetOutput("D:\java\bin\JAVAC" "^%File%")$
        ^!InsertText ^$GetOutput("D:\jdk1.1.8\bin\JAVAC -deprecation"
        "^%File%")$

        ;// Close the file if command produced no output.
        ^!If ^$GetTextSize$ > 1 SKIP
        ^!Close DISCARD
        ;// Check for an error file
        ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
        ;// No errors to refocus on source code document
        ^!SetDocIndex ^%DocIndex%
        ^!GOTO END
        ;// Load and display errors
        :DISPLAYERROR
        ^!OPEN ^%ErrorFile%
        ^!SetWordWrap ON
        ^!SOUND SystemExclamation
        *****end clip******

        H="Jump to Line from Error Output"
        ;Wayne VanWeerthuizen <wayne@...>
        ;Tue, 11 Jan 2000 11:50:55 -0800
        ;This update stops NoteTab from printing error messages if the clip
        is
        ;accidentally used on a document that does not contain error
        message
        ;output, and allows the cursor to be placed on any line of the error
        ;message, instead of just the first. I don't expect it will need any
        ;more updates, unless something needs to be changed to make it
        work
        ;better with the output of other compilers that I've not yet tested.
        :Redo
        ^!FocusDoc
        ; Look from current cursor position for something resembling:
        ; <Path and Filename><colon><number><colon><space>
        ^!Select LINE
        ^!Find ": " SH
        ^!IfError Error
        ^!Jump Select_Start
        ^!Set %Position%="^$GetRow$:^$GetCol$"
        ^!Find ":" BS
        ^!IfError Error
        ^!Jump Select_End
        ^!SelectTo ^%Position%
        ^!Set %Line%="^$GetSelection$"
        ; Line Number has been found.
        ^!Jump Select_Start
        ^!MoveCursor -1
        ^!Select BOL
        ^!Set %File%="^$GetSelection$"
        ; Filename has been found.
        ^!Open ^%File%
        ^!Jump ^%Line%
        ^!Goto Exit
        ; If we had an error, it means a find failed, which means the
        ; cursor was not on the first line of an error message. We back
        ; up a line and try again. (The -2 is because the above code
        ; moves the cursor down a during the search line.)
        :Error
        ^!If ^$GetRow$ < 2 Exit
        ^!Jump -2
        ^!Goto Redo
        ****end clip****

        Here is one I made to run a Java program from the *.java file in
        focus in NoteTab.

        ---------< start clip >---------
        H="Run with Java2"
        ;Larry Hamilton, Jr. <LM_Hamilton@...>
        ;02/02/2001, 05:34:28 PM
        ;^!SetDebug On
        ;This Clip will run Java applets from the commandline, if their *.java
        file is focused in NoteTab. So far this only works with JDBC
        applets, that output to commandline. Need a way to get output into
        a text file or applet display.
        ^!SET %ErrorFile%=^$GetStdErrorName$
        ^!DestroyDoc ^%ErrorFile%
        ;This command only gives the name of the file, so can use to get
        name of *.java to run *.class.
        ^!ChDir D:\NoteTab\Documents\java\
        ^!Set %file%=^$GetName(^**)$
        ;Commandline to run a java applet from commandline.
        ;^!SetClipboard=java ^%file%
        ;^!Info ^$GetOutput("D:\jdk1.1.8\bin\JAVA -classpath
        D:\NoteTab\Documents\java\ ^%File%")$
        ^!SetWizardTitle Run with Java2 Output Stream
        ^!SetWizardLabel Output Stream:
        ^!Info ^$GetInputOutput("JAVA -classpath
        D:\jdk1.1.8\lib\classes.zip;D:\jdk1.1.8\lib\solid\jdbc\;D:\NoteTab\Do
        cuments\java\ ^%File%")$
        ;java -classpath
        D:\jdk1.1.8\lib\classes.zip;D:\jdk1.1.8\lib\solid\jdbc\;D:\Downloads\J
        ava\sj23win\samples\ sample1
        ;^!Info ^$GetStdErrorName$

        ^!If ^$GetTextSize$ > 1 SKIP
        ^!Close DISCARD
        ;// Check for an error file
        ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
        ;// No errors to refocus on source code document
        ^!SetDocIndex ^%DocIndex%
        ^!GOTO END
        ;// Load and display errors
        :DISPLAYERROR
        ^!SetWizardTitle Error Stream
        ^!Info ^$GetFileText(^%ErrorFile%)$
        ^!OPEN ^%ErrorFile%
        ^!SetWordWrap ON
        ^!SOUND SystemExclamationt
        ---------< end clip >-----------

        Another helpful set of clips:

        H="Get Usage"
        ;03/24/2000
        ;This Clip will send Java commands to the commandline, and will
        return the usage to an info box. CAUTION: If a command does not
        generate usage information, this could cause problems.
        ;^!SetDebug On
        ^!ClearVariables
        ^!SET %ErrorFile%=^$GetStdErrorName$
        ;^!Set %pgm%=^?{Java Exe=}
        ;^!Set %param%="-help"
        ^!DestroyDoc ^%ErrorFile%

        ^!SetHintInfo Calculating...
        ^!SetListDelimiter=^%SPACE%
        ^!SetArray
        %FileList%=^$GetFiles(^?[(T=D)Directory=D:\jdk1.1.8\bin];"*.exe")$

        ^!Set
        %list%=^$StrReplace("D:\jdk1.1.8\bin\";"|";"^%FileList%";False;Tru
        e)$
        ^!Set %list2%=^$StrReplace(".exe
        ";"^%EMPTY%";"^%List%";False;True)$
        ^!Set %Show%=^$StrDelete("^%List2%";1;1)$

        ^!SetWizardTitle Get Java Command Usage
        ^!SetWizardLabel These are the Java commands in your JDK:
        ^!Info ^%Show%
        ^!Set %pgm%=^?{(T=C;H=24)Exe's=^%Show%}

        ;^!ChDir D:\NoteTab\Documents\java\
        ;Commandline to run a java applet from commandline.
        ^!SetWizardTitle Command Usage
        ^!Info ^$GetInputOutput("^%pgm%")$
        ;^!Info ^$GetOutput("^%pgm%")$

        ;java -classpath
        D:\jdk1.1.8\lib\classes.zip;D:\jdk1.1.8\lib\solid\jdbc\;D:\Downloads\J
        ava\sj23win\samples\ sample1

        ^!If ^$GetTextSize$ > 1 SKIP
        ^!Close DISCARD
        ;// Check for an error file
        ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
        ;// No errors to refocus on source code document
        ^!SetDocIndex ^%DocIndex%
        ^!GOTO END
        ;// Load and display errors
        :DISPLAYERROR
        ^!SetWizardTitle Error Stream
        ^!Info ^$GetFileText(^%ErrorFile%)$
        ;^!OPEN ^%ErrorFile%
        ^!SetWordWrap ON
        ;^!SOUND SystemExclamation
        ***end clip*****

        H="Get Usage2"
        ;03/24/2000
        ;This Clip will send Java commands to the commandline, and will
        return the usage to an info box. CAUTION: If a command does not
        generate usage information, this could cause problems.
        ;^!SetDebug On
        ^!ClearVariables
        ^!SET %ErrorFile%=^$GetStdErrorName$
        ^!DestroyDoc ^%ErrorFile%
        ^!SetListDelimiter=|
        ;----------------------[begin long line]---------------------------
        ^!Set
        %List%=^$StrReplace("D:\jdk1.1.8\bin\";;"^$GetFiles("D:\jdk1.1.8\bi
        n\";"*.exe")$";False;False)$
        ;-----------------------[end long line]----------------------------
        ^!Set
        %List%=^$StrCapitalize("^$StrReplace(".exe";;"^%List%";False;Fal
        se)$")$
        ^!Set %Value%=^?{(H=15)Choose Java program to
        execute==^%List%}

        ^!Info ^$GetInputOutput("^%Value%")$

        ^!If ^$GetTextSize$ > 1 SKIP
        ^!Close DISCARD
        ;// Check for an error file
        ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
        ;// No errors to refocus on source code document
        ^!SetDocIndex ^%DocIndex%
        ^!GOTO END
        ;// Load and display errors
        :DISPLAYERROR
        ^!SetWizardTitle Error Stream
        ^!Info ^$GetFileText(^%ErrorFile%)$
        ;^!OPEN ^%ErrorFile%
        ^!SetWordWrap ON
        ;^!SOUND SystemExclamation


        On 26 Jan 2001, at 14:57, Clint Tredway wrote:

        > Doesn't some one have a clip for compiling and running java code
        from Note
        > Tab?
        >
        > Clint
        Larry Hamilton, Jr.
        lm_hamilton@...
        http://notlimah.tripod.com/
        Hamilton National Genealogical Society, Inc.
        http://www.hamiltongensociety.org/
      Your message has been successfully submitted and would be delivered to recipients shortly.