1

Below is the sample code

SUBROUTINE HELLO.WORLD
*-----------------------------------------------------------------------------
*
*-----------------------------------------------------------------------------
* Modification History :
*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------

CRT "HELLO WORLD"

END

Compilation error;

01/01/2019 16:26:03 Compiling HELLO.WORLD...                    ERROR
     Error : (line 12) HELLO.WORLD.b, No component defined. $PACKAGE is mandatory !
Compilation completed for 1 file(s). 1 error
01/01/2019 16:26:03 Compiling HELLO.WORLD...                    ERROR
     Error : (line 12) HELLO.WORLD.b, No component defined. $PACKAGE is mandatory !
Compilation completed for 1 file(s). 1 error

I have setup (during toggle tafj project nature option in design studio);

  • The TAFJ_HOME correctly.
  • T24lib directory under "Known Libraries" section.
  • Java folder : ....\ProjectName-models\java.
  • Class folder : ....\ProjectName-models\classes.

Thank you

greg-449
  • 109,219
  • 232
  • 102
  • 145
Carlos
  • 81
  • 4
  • 10

4 Answers4

2

To switch off this check for tCompile, set these properties in tafj.properties:

temn.tafj.compiler.internal.development=false
temn.tafj.compiler.component.strict.mode=false

However, to follow the "best practice way" you should have the $PACKAGE statement, then your JBC code will be compiled into a proper Java Package and put inside a JAR file. Note that before that you should do "New-->T24Component Folder Structure" in T24 Design Studio. This will create the XX.componentname.component file where you can define the subroutines. This "XX.Local.component" has to be compiled first:

component XX.Local
# Component Isolation Definition
metamodelVersion 1.6
# -------------------------------------------------

public method helloWorld ()
{
    jBC: HELLO.WORLD
}

Then you can reference the $PACKAGE in the subroutine like this:

$PACKAGE XX.Local
SUBROUTINE HELLO.WORLD
    CRT 'Hello, World!'
RETURN
END

The component can also be created manually without Design Studio. You should not use the Dunce Cap (see this: https://en.wikipedia.org/wiki/Dunce) unless you have a good reason.

PrecisionLex
  • 801
  • 11
  • 26
0

Right click on project source folder and click “Put on / Take off the Dunce cap”. Compile again.

enter image description here

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Natty
  • 185
  • 1
  • 1
  • 9
  • I tried to use this feature. Though I couldn't find the option in the right click menu. What is the design studio version you are using? (I am trying with R19) – Carlos Aug 29 '19 at 06:15
  • Iam using R18 and I have the option in right click menu. It seems the dunce cap feature removed in R19 (TAFJ eclipse document). Try using the component feature. – Natty Sep 18 '19 at 09:31
0

For R19 Right Click on project navigate to Properties->TAFJ->Compiler->Uncheck Maintain validation code.

pavan
  • 1
  • 1
-1

It's a subroutine , it needs a RETURN statement

Flexo
  • 87,323
  • 22
  • 191
  • 272