Include statement

Software AG's platform-independent programming language with full support for open-source and Internet applications
Arkantos
Posts: 18
Joined: Fri Apr 16, 2010 10:06 am
Skillset: Natural Adabas
Referer: Friends

Include statement

Postby Arkantos » Thu Jul 29, 2010 11:19 am

Hi,

I tried to create a dynamic include statement like,

INCLUDE READ-C '#FILE-NAME' '#FILE-KEY' '#FIELD-VALUE' .

But im getting NAT0274 Error 623 in line 20 of copycode.

READ-C :

0010 *
0020 READ &1& BY &2& EQ '&3&'
0030 *
0040 IF &2& NE &3&
0050 ESCAPE BOTTOM
0060 END-IF
0080 *
0090 END-READ

But if i use

INCLUDE READ-C 'EMPLOYEE' 'EMPLOYEE-NAME' '#FIELD-VALUE'

im not getting any error.

Cant we create a dynamic input field like #FILE-NAME while using a copycode ?

Regards
Arkantos

User avatar
RGZbrog
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Skillset: Natural, Adabas, Predict, Natural Security, Construct, EntireX, SPoD, NaturalONE
Referer: SAG Developer Forum
Location: California, USA
Contact:

Re: Include statement

Postby RGZbrog » Thu Jul 29, 2010 1:20 pm

After the compiler has replaced the tags with the supplied values, the result must be valid Natural source code.

The second example works because EMPLOYEE is a valid view name. The first example fails because there is no such view as #FILE-NAME.

The syntax of a READ statement requires a view name, as in READ view. The view cannot be specified as the contents of a variable, what you refer to as a "dynamic input field." You would have to know all the view names and code something like

Code: Select all

DECIDE FOR FIRST CONDITION
  WHEN something
       INCLUDE READ-C 'EMPLOYEE' ...
  WHEN something-else
       INCLUDE READ-C 'VEHICLE' ...

Arkantos
Posts: 18
Joined: Fri Apr 16, 2010 10:06 am
Skillset: Natural Adabas
Referer: Friends

Re: Include statement

Postby Arkantos » Thu Jul 29, 2010 2:54 pm

Thanks RGZbrog .


  • Similar Topics
    Replies
    Views
    Last post