Include statement



Software AG's platform-independent programming language with full support for open-source and Internet applications

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
Arkantos
 
Posts: 18
Joined: Fri Apr 16, 2010 10:06 am
Has thanked: 0 time
Been thanked: 0 time

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

DECIDE FOR FIRST CONDITION
  WHEN something
       INCLUDE READ-C 'EMPLOYEE' ...
  WHEN something-else
       INCLUDE READ-C 'VEHICLE' ...
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time

Re: Include statement

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

Thanks RGZbrog .
Arkantos
 
Posts: 18
Joined: Fri Apr 16, 2010 10:06 am
Has thanked: 0 time
Been thanked: 0 time


Return to Natural

 


  • Related topics
    Replies
    Views
    Last post