Compilation Errors

As a compiler, Lycia 3 reports the errors in the source code to the 4gl developer. There are several types of errors, the most common of them being syntax and logical ones.

 

Below you can find the most frequent compilation errors together with some simple examples of the erroneous 4gl coding.

 

 

Error code

Error type

Displayed message

Example of erroneous 4gl code

1005

logical

The specified variable is not defined in this context. Check that it is spelled correctly and that it's DEFINE statement is formatted correctly

FUNCTION f()

  LET a = 1

END FUNCTION

1006

logical

A record-type variable is required to perform the operation you have requested. For example, if you have written "myfield.*", myfield must be a record

MAIN

  DEFINE a INT

  DISPLAY a.*

END MAIN

1007

syntax, logical

The specified field does not appear to exist in the record. Check the record definition to ensure that the field is spelled correctly. If the record is declared "LIKE" a database table, check the database to ensure that the column exists in the database table

MAIN

  DEFINE r1 RECORD

   f1 INT,

   f2 CHAR(32)

  END RECORD

  LET r1.f3 = 3

END MAIN

1008

logical

An array-type variable is required to perform the operation you have requested. For example, if you have written "myarray[10]", it must be declared as a 4gl ARRAY

MAIN

  DEFINE f FLOAT

  LET f[1] = 1

END MAIN

1013

logical

A variable is being defined like the specified table, but Lycia cannot find this table in the database. Check the table exists and, that a DATABASE statement corresponding to this database appears outside of any functions, reports or main blocks

database auth

MAIN

  DEFINE r LIKE unknown_table.*

END MAIN

1014

logical

A variable is being defined like the specified column, but Lycia cannot find this column in the database. Check the table and column exist and, that a DATABASE statement corresponding to this database appears outside of any functions, reports or main blocks

database auth

MAIN

  DEFINE r LIKE unknown_table.unknown_field

END MAIN

1016

logical

The specified array size is not a positive integer

DEFINE a ARRAY[0] OF INT

1020

syntax

(4gl does not allow this)

A qualifier specified for a datetime or interval is not valid

MAIN

  DEFINE intr INTERVAL YEAR TO DAY

END MAIN

1037

syntax

The specified data type does not correspond to a 4gl data type or any user-defined type. Check the typename to ensure, that it is spelled correctly

MAIN

  DEFINE a SOMEUNKNOWNTYPE

END MAIN

1039

syntax

You have declared a menu, but do not appear to have any COMMAND statements. Check the menu declaration to ensure that there is at least one "COMMAND" statement associated with it

MAIN

  MENU

  END MENU

END MAIN

1041

logical

The left hand and right hand sides of the THRU statement do not appear to have any common ancestors. In order to use THRU, the left hand and right hand sides must both be within the same record:

     myrec.f1 THRU myrec.f5

     myrec.subrec.fld1 THRU myrec.subrec.fld3,

     and myrec.f2 THRU myrec.subrec.fld1

are both valid, but

     myrec.f1 THRU otherrec.f5

is not

MAIN

  DEFINE a ARRAY[4] OF INT

  DISPLAY a[1] THRU a[4]

END MAIN

1046

logical

(aggregate function can be used only inside the SqlStmts)

Lycia does not know how to create an aggregate from the specified function, or an aggregate function is not within a report event block

MAIN

  Call COUNT(*)

END MAIN

1049

syntax

A run statement can either specify NOWAIT or RETURNING but not both.

NOWAIT indicates that the call should return immediately without waiting for the process to terminate, RETURNING indicates that you wish to know the return code of the process.

You cannot get the exit code if you do not wait for the process to exit

MAIN

  DEFINE a INT

  RUN "cmd.exe" WITHOUT WAITING RETURNING a

END MAIN

1051

syntax

The between operator must be followed by an expression of the for X AND Y

DATABASE auth

MAIN

  DEFINE a INT

  SELECT col_1 {int} FROM tab_test WHERE

         col_1 BETWEEN 1 OR 2

END MAIN

1056

syntax

(RDBMS restriction)

The select statement is invalid

DATABASE auth

MAIN

  SELECT * FROM customer INTO TEMP

        cust_user UNION SELECT * FROM users

END MAIN

 

(We can put into temp only the formed data set)

1057

logical

You have used a "SELECT" statement in the context of a value outside of an SQL statement (e.g.:

     LET val = SELECT something FROM mytable, or

     RETURN SELECT something FROM mytable)

Lycia cannot currently perform this operation.

This error may occur when a statement which takes an optional argument (such as RETURN) is followed by a select statement. You can prevent it by adding a ";" symbol to the end of the first statement

DATABASE auth

MAIN

  DEFINE a INT

  LET a = SELECT col_1 FROM tab_test WHERE

      col_2 = "somevalue"

END MAIN

1060

logical

An attempt has been made to use both SQL variable placeholders (?) and program variables in the same statement:

DEFINE myval integer

DECLARE mycrs CURSOR FOR SELECT * from mytable where mytable.col1 = myval and mytable.col2 = ?

You must use either "?" placeholders (in which case the parameters must be supplied when the cursor is opened), or program variables

DATABASE auth

MAIN

  DEFINE str CHAR(32)

  LET str = "something"

  DECLARE mycrs CURSOR FOR

  SELECT * from tab_test where

         tab_test.col_1 = ? and

         tab_test.col_2 = str

END MAIN

1062

logical

You cannot use SQL placeholders in an inline SQL statement, since the compiler needs to know the values to assign to the placeholders in order to execute the statement

DATABASE auth

MAIN

  SELECT * FROM tab_test WHERE col_1 = ?

END MAIN

1067

logical

The specified array dimensions is not a positive integer

DATABASE auth

MAIN

  DEFINE darr1 DYNAMIC ARRAY WITH -1

         DIMENSIONS OF INTEGER

END MAIN

1068

logical

The specified field has already been defined in this record

MAIN

  DEFINE a RECORD

   f1 INT,

   f1 CHAR(32)

  END RECORD

END MAIN

1069

syntax

Variables of RECORD type cannot be referenced in the current context. To use a variable of RECORD type in the current context, it must be expanded with the '.*' syntax

FUNCTION f(r)

  DEFINE r RECORD

   field1 INT,

   field2 CHAR(32)

  END RECORD

  RETURN r

END FUNCTION

5066

license

Not enough license seats for Lycia Compiler service.

Your license does not have any available Lycia Compiler seats. This may happen because all the seats are occupied, your license does not include the seats of the required type or your license has expired.

To free the seats, terminate the processes which occupies them (e.g. close a running 4GL program to free a LyciaRuntime seat).

Contact Querix support team (support@querix.com) to add new seats to your license or to renew the license.