Our "favourite" eCompile errors.

Here you can post threads on the development of the current release of the core (100)

Moderator: POL Developer

Post Reply
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Our "favourite" eCompile errors.

Post by Yukiko »

This thread is intended for posting those cryptic or hard to understand eCompile errors. I invite everyone to post errors you have received from eCompile that just did not make sense or did not do a reasonable job of communicating the nature of the error. Please try to avoid posting duplicate errors. Hopefully this list can be used by the Core developers to improve eCompile's error reporting.

When posting your errors please do your best to explain in detail what caused this error, assuming you were able to correct it. :)

I will start us off with my favourite error:

Code: Select all

EScript Compiler v1.13
Copyright (C) 1993-2018 Eric N. Swanson

Compiling: D:\GitHub\DistroDev\pkg\commands\test\target.src
Expected an identifier, got User Function TruncateArticle instead.
Near: function TruncateArticle(x)
File: D:/GitHub/DistroDev/pkg/commands/include/string.inc, Line 6
File: D:/GitHub/DistroDev/pkg/commands/include/string.inc, Line 6
Error reading function
File: D:/GitHub/DistroDev/pkg/commands/include/string.inc, Line 6
Compilation failed.
Execution aborted due to: Error compiling file
>Exit code: 1
This error is caused if you have two or more functions with the same name. The functions can either be in the same file, one in the src file and one in an include or in multiple include files.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Our "favourite" eCompile errors.

Post by Yukiko »

Another favourite of mine:

Code: Select all

EScript Compiler v1.13
Copyright (C) 1993-2018 Eric N. Swanson

Compiling: D:\GitHub\DistroDev\pkg\commands\test\target.src
Non-identifier declared as a variable: 'playmusic'
Token: Func(2,12): playmusic
Error compiling statement at D:\GitHub\DistroDev\pkg\commands\test\target.src, Line 25
Error detected in program body.
Error occurred at D:\GitHub\DistroDev\pkg\commands\test\target.src, Line 25
Execution aborted due to: Error compiling file
>Exit code: 1
This occurs when I declare a variable with the same name as a function, in this case the variable is playmusic which is the same name as a function in uo.em, PlayMusic(). It does not have to be a function in a *.em though. The function can be in any include file or the main source file.
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Our "favourite" eCompile errors.

Post by DevGIB »

Recently raised by Arvax on Discord, and then solved by Turley, the use of the names Check and Start as function names is not allowed although they are not in the reserved words list.

Code: Select all

Compiling: ../pkg/systems/instances/instance_stone.src
Error reading function declaration in module basic
Constant TRIM_LEFT has already been defined.
Token '(' cannot follow token 'CInt'
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Our "favourite" eCompile errors.

Post by DevGIB »

Using a reserved word in the function definition doesn't expressly say that the word is reserved.

code example:

Code: Select all

use cfgfile;
use uo;
use os;

include "include/client";

program close_door(downto)
error example:

Code: Select all

Compiling: \pkg\items\doors\closeDoor.src
Expected arguments or right-paren in program arglist, got 'Unknown Token: (268,8,'downto')'
Error detected in program body.
Error occurred at \pkg\items\doors\closeDoor.src, Line 8
Execution aborted due to: Error compiling file
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Our "favourite" eCompile errors.

Post by DevGIB »

Code: Select all

Foreach prop in (testarray)
	tempreading := targ.get_memberprop);
	if( !tempreading )
		failstring := failstring + " r";
	else
For whatever reason gives the following response:

Code: Select all

Compiling: H:\UO\POL\Distro\pkg\tools\proptester\textcmd\gm\testsetprop.src
Error compiling statement at H:\UO\POL\Distro\pkg\tools\proptester\textcmd\gm\testsetprop.src, Line 36
Error compiling statement at H:\UO\POL\Distro\pkg\tools\proptester\textcmd\gm\testsetprop.src, Line 35
Error detected in program body.
Error occurred at H:\UO\POL\Distro\pkg\tools\proptester\textcmd\gm\testsetprop.src, Line 36
Execution aborted due to: Error compiling file
Its good that it gives the exact line but not really a specific error.
Post Reply