Invalid Parameter Name? What?!?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-29
01:14 AM
- last edited on
‎2023-05-24
10:32 AM
by
Rubia Torres
‎2006-07-29
01:14 AM
IF pFrameType = `HM` THEN PARAMETERS pFrameGuage = `16` ELSE PARAMETERS pFrameGuage = `18` ENDIF
Simple enough, right? When I check the script with the Check Script button, it complains that "'PFRAMEGUAGE' isn't a valid parameter name" on the fourth line -- the one that attempts to set it to `18`. This means that it accepted the second line which sets it to `16`. I've done this same code snippet with several other variables and they all work -- just not this one.
I tried:
IF pFrameType = `HM` THEN PARAMETERS pFrameGuage = `16` ENDIF IF pFrameType <> `HM` THEN PARAMETERS pFrameGuage = `18` ENDIF
...and Check Script complained.
I tried:
PARAMETERS pFrameGuage = `18` IF pFrameType = `HM` THEN PARAMETERS pFrameGuage = `16` ENDIF
...and Check Script complained about the first line, but if I click Continue, it doesn't complain about the third line.
I tried:
IF pFrameType = `HM` THEN temp = `16` ELSE temp = `18` ENDIF PARAMETERS pFrameGuage = temp
...and Check Script complained about the last line.
Now for the strangest part. If I take the "ELSE" line out of the first example so the code looks like the following:
IF pFrameType = `HM` THEN PARAMETERS pFrameGuage = `16` PARAMETERS pFrameGuage = `18` ENDIF
The Check Script says everything is fine! WTH!?!

It seems that every time I write a GDL with a lot of decision-making code, some part of it is guaranteed to fail with no perceptible reason. In the past I've had one LOCK call out of 20 not lock it's variable. I've had random HIDEPARAMETER calls refuse hide their parameters. It's a complete crap-shoot.
I'm about to give up doing any more smart GDLs because I easily kill an hour trying to figure out just one of these stupid little problems with no success. Any ideas?
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-29 02:56 AM
‎2006-07-29
02:56 AM
just an idea - try a completely new paramater. If that works abandon the old one. (better still delete the parameter and then add again)
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-29 08:04 AM
‎2006-07-29
08:04 AM
Jay,
try this:
pFrameGuage = ``
IF pFrameType = `HM` THEN
PARAMETERS pFrameGuage = `16`
ELSE
PARAMETERS pFrameGuage = `18`
ENDIF
I have noticed that in some cases you need to pre-format the string variable to 'string'
try this:
pFrameGuage = ``
IF pFrameType = `HM` THEN
PARAMETERS pFrameGuage = `16`
ELSE
PARAMETERS pFrameGuage = `18`
ENDIF
I have noticed that in some cases you need to pre-format the string variable to 'string'
::rk
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-30 09:11 PM
‎2006-07-30
09:11 PM
John had the winning answer. First I added a Test parameter and used Test in the code instead of pFrameGuage, and it worked. So I deleted the original pFrameGuage parameter and renamed Test to pFrameGuage -- it worked.
The moral of this story is...
If the GDL interpreter doesn't like one of your parameters -- even though it should -- throw the parameter away and try again. Don't question why -- it will just drive you crazy!
The moral of this story is...
If the GDL interpreter doesn't like one of your parameters -- even though it should -- throw the parameter away and try again. Don't question why -- it will just drive you crazy!


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-30 11:41 PM
‎2006-07-30
11:41 PM
One tangential tidbit, Jay, for you and all others learning GDL:
You spelled your variable name as "pFrameGuage", but I suspect you meant "pFrameGauge" (unless guage means something in Spanish or ...).
It's really good IMHO to use meaningful variable names as you have, but a very common error happens when these names are spelled (or typed) incorrectly. Suppose a future programmer works on your object and pronounces the name in his head correctly and spells it correctly as well? The correctly spelled version (which does not match your name) will be an undefined variable ... which GDL interprets as having the value zero (0). I'd suggests a 'replace all' to nip this in the bud.
Of course, typos happen in scripts all the time... resulting in incorrect script execution (because the name is valid, but the value of 0 screws things up). Somewhere on the wish list was a wish for requiring variables to be declared, as in many programming languages, so that these kinds of errors could be caught by "Check Script"...
Cheers,
Karl
You spelled your variable name as "pFrameGuage", but I suspect you meant "pFrameGauge" (unless guage means something in Spanish or ...).
It's really good IMHO to use meaningful variable names as you have, but a very common error happens when these names are spelled (or typed) incorrectly. Suppose a future programmer works on your object and pronounces the name in his head correctly and spells it correctly as well? The correctly spelled version (which does not match your name) will be an undefined variable ... which GDL interprets as having the value zero (0). I'd suggests a 'replace all' to nip this in the bud.
Of course, typos happen in scripts all the time... resulting in incorrect script execution (because the name is valid, but the value of 0 screws things up). Somewhere on the wish list was a wish for requiring variables to be declared, as in many programming languages, so that these kinds of errors could be caught by "Check Script"...
Cheers,
Karl
AC 28 USA and earlier • macOS Sequoia 15.4, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-30 11:48 PM
‎2006-07-30
11:48 PM
Karl wrote:
You spelled your variable name as "pFrameGuage", but I suspect you meant "pFrameGauge"
It looked kinda weird, but I was busy trying to keep my train of thought late on a Friday afternoon.


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-31 12:54 AM
‎2006-07-31
12:54 AM
Jay wrote:Good to hear Jay
John had the winning answer. First I added a Test parameter and used Test in the code instead of pFrameGuage, and it worked. So I deleted the original pFrameGuage parameter and renamed Test to pFrameGuage -- it worked.
The moral of this story is...
If the GDL interpreter doesn't like one of your parameters -- even though it should -- throw the parameter away and try again. Don't question why -- it will just drive you crazy!
Just a tip - make sure you dont save the object while the parameter is missing and open a project as any modified parameters of that variable (in a placed object) will be lost.
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019 [/size]