Menu

@java-code error

Help
2011-10-29
2013-03-18
  • nenad cikic

    nenad cikic - 2011-10-29

    Hello,
    i can not understand how to use @java-code directive
    my code is as follows:
       MEMBER('wmj.clw')                                       ! This is a MEMBER module

                         MAP
                           INCLUDE('WMJ003.INC'),ONCE        !Local module procedure declarations
                         END

    QiqoMjenjaci         PROCEDURE                             ! Declare Procedure
    qqq string(5)
      CODE
    compile('java-end',java)
    @java-code 'System.out.println("q1eqwqweq");' ()
    java-end

    and when i build with mvn i get "clarionCompilError> Expected eof near line 14 …" which is the @java-code line

    I have tried various variations of that line but can not make it to work.
    thanks
    Nenad

     
  • nenad cikic

    nenad cikic - 2011-10-29

    I have managed to make it work.
    if the lines are
    compile('java-end',java)
    @java-code 'System.out.println("q1eqwqweq");'
    java-end

    then it will not build but if either are:
    compile('java-end',java)
    @java-code 'System.out.println("q1eqwqweq");'    !NOTE the space at begining of line
    java-end

    or all three lines start from column 2 as
    compile('java-end',java)
    @java-code 'System.out.println("q1eqwqweq");'
    java-end

    then it is ok
    I think this could be treated as bug. Anyway i can now use @java-code
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-10-30

    @java-code is treated like any other clarion statement.  It must be indented.  Otherwise it is considered to be a label.

    (This is one of my few bug bears with clarion syntax. Whitespace conveys lexical meaning. Most mainstream languages do not do this. A notable exception being Python).

     

Log in to post a comment.

Auth0 Logo