Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

invalid non-declared variable

rocorona
Booster
can you reproduce/explain this behavior?

In a master script:

DEFINE TRANSLUCENT_FILL "test1" zero,2,3,4,5,6,7,8, 0.25
zero=0
DEFINE TRANSLUCENT_FILL "test2" zero,2,3,4,5,6,7,8, 0.25


when checking these instructions, ArchiCAD reports "insufficient parameters" for the first DEFINE, where a non-declared variable is used.
Thes second one is copy-pasted, to avoid any possible difference, but the zero is declared, and it works.

--Roberto Corona--
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
13 REPLIES 13
Anonymous
Not applicable
Hi Laszlo,

The lack of detail in a error message is directed linked to the enthusiasm for a software...
I mean... a new user who reads the actual AC error messages looses a considerable portion of enthusiasm as it doesn't point to a detail solution for the error.
Huge impact and very simple to implement...
Good idea Laszlo!...
rocorona
Booster
ztaskai wrote:
When using numeric variables, you should initialize them before their value is used for the first time.
[...]
Zsolt


As an old BASIC programmer, I absolutely agree that declared variables are "safer" and a good programming practice.
I only noticed that strangeness when copying-pasting the syntax from the GDL manual for a quick test.
The worst, as pointed out by others, is the cryptic error message ("insufficient parameters").

Anyway, the same use of an undeclared variable, works without problems in "old" Define Fill.

DEFINE FILL "testfill" undeclared, 2, 3, 4, 5, 6, 7, 8,
1, 0.0, 2,
0.1, 0.0, 0.0, 0.0, 0,
0.1, 90.0, 0.0, 0.0, 0,
1.0, 1.0
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
ztaskai
Graphisoft Alumni
Graphisoft Alumni
Hi all,

Yes, non-declared variables will keep working. They are always considered as numeric variables with the value of zero.

And yes, we should have better error messages. I don't think we can change them all in one big chunk but we'll try to go in the proposed clearer direction with new messages and when touching old ones.

About AC13 and GDL... I'm really happy about the fixes and changes we make but I'm afraid only one of the fundamental problems will be solved. I will post a summary about the little and bigger changes when we enter alpha phase. Feel free to remind me in case I appear to forget about that.

Regards,
Zsolt
Zsolt Táskai
ArchiCAD Development - GDL Team
AC13, AC14 and upwards...
Anonymous
Not applicable
Thank you very much for your feedback Zsolt.
ztaskai wrote:
I will post a summary about the little and bigger changes when we enter alpha phase.
I'm looking foward!