POLY_A & POLY_B Syntax Errors
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-08 11:46 PM
2008-04-08
11:46 PM
This has been discussed but I've not found a resolution to a syntax problem with both sub-routines. Nicholson-Cole warns about POLY2_A but appears to be able to use POLY2_B. I can't find a way to use either.
eg POLY2_A n, frame_fill, fill_pen, x1, y1, s1, ..., xn, yn, sn
POLY2_A 5, 3, 3,
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
One extra parameter :
e.g POLY2_B n, frame_fill, fill_pen,fill_background_pen,x1, y1, s1, ..., xn, yn, sn
POLY2_A 5, 3, 3, 3,
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
The GDL compiler generates a number of errors :
1 Illegal character in line 22 (the first line)
2 Keywords can't be used as variables in line 22
3 Parameter expression error or unnecessary end comma in line 22 (I've tried with and without the end comma in line 22)
Has anyone managed to get these sub-routines working?
I request the code be tried to see it it works as written. If not please post the modified code in the reply.
Regards : Douglas Wagner
7 REPLIES 7
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 04:52 AM
2008-04-09
04:52 AM
I copied your code for the POLY2_A command and it works as written
with no errors. I did define a fill and a pen (FILL "Empty Fill" and PEN 6)
but that does not explain why you are getting errors.
I have no explanation for why you are getting errors.
Peter Devlin
with no errors. I did define a fill and a pen (FILL "Empty Fill" and PEN 6)
but that does not explain why you are getting errors.
I have no explanation for why you are getting errors.
Peter Devlin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 03:15 PM
2008-04-09
03:15 PM
Hello Peter :
Thank you for your reply.
Please post the entire sub-routine as you've written it. I believe there must be a way of writing the parameters which I've overlooked.
Where and how do you define the fill and pen?
The code below doesn't work either.
Replacing the double quotes with single quotes make no difference.
POLY2_A 5, "Empty Fill", 6,
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
Regards : Douglas Wagner
Thank you for your reply.
Please post the entire sub-routine as you've written it. I believe there must be a way of writing the parameters which I've overlooked.
Where and how do you define the fill and pen?
The code below doesn't work either.
Replacing the double quotes with single quotes make no difference.
POLY2_A 5, "Empty Fill", 6,
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
Regards : Douglas Wagner
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 05:35 PM
2008-04-09
05:35 PM
Frame_fill is not a fill name, it's a bit of binary arithmetic like a status code. It controls whether the contour (1), or the fill (2), or both (1+2=3) is drawn. And other stuff, see the manual.
Set the fill, then do the shape.
FILL "Empty Fill"
POLY2_B etc...
Set the fill, then do the shape.
FILL "Empty Fill"
POLY2_B etc...
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 05:54 PM
2008-04-09
05:54 PM
Hello James :
Thank you for your reply.
However, I don't entirely understand your point.
You appear to be suggesting the code below.
FILL "Solid Fill"
POLY2_A 5, 3, 3
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
where the "3" following the "5" is the frame_fill code.
This produces the series of errors I described in my first post.
POLY2_A 5, 2+1, 3
This doesn't work either.
I've read the manual, of course. Indeed, Peter was able to run my code without errors. There appears to be something more subtle going on here.
Regards : Douglas Wagner
Thank you for your reply.
However, I don't entirely understand your point.
You appear to be suggesting the code below.
FILL "Solid Fill"
POLY2_A 5, 3, 3
0, 0, 1,
maxWidth, 0, 1,
maxWidth, length, 1,
0, length, 1,
0, 0, -1
where the "3" following the "5" is the frame_fill code.
This produces the series of errors I described in my first post.
POLY2_A 5, 2+1, 3
This doesn't work either.
I've read the manual, of course. Indeed, Peter was able to run my code without errors. There appears to be something more subtle going on here.
Regards : Douglas Wagner
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 07:02 PM
2008-04-09
07:02 PM
Douglas wrote:This syntax is wrong:
Hello James :
Thank you for your reply.
However, I don't entirely understand your point.
POLY2_A 5, "Empty Fill", 6,
In that bit you're missing a comma at the end of the first line. "Not enough parameters", the only error I got, can be caused by missing commas. I tested it with the comma and it works.FILL "Solid Fill" POLY2_A 5, 3, 3 0, 0, 1, maxWidth, 0, 1, maxWidth, length, 1, 0, length, 1, 0, 0, -1
Both items in your original post work too, once you change the second POLY2_A to a B.
The errors you describe there are familiar. Sometimes when pasting text from web pages or PDF into a script you can get invisible nonsense characters, very annoying. Try mouse-highlighting text before and after the code, or forward-deleting at the end of each line, or typing it over.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-09 07:07 PM
2008-04-09
07:07 PM
James wrote:Another trick is to do a select-all on the text. Bumpy empty lines are a clue; delete them. (Though the pic is a spacebar-simulation of the effect.)
invisible nonsense
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-04-11 04:17 AM
2008-04-11
04:17 AM
Hello James :
Thank you for your assistance. I've got POLY2_B working as needed.
I believe your remark about invisible characters was correct. (And I did copy the code template from the manual and that is probably where that character came from).
The other errors were merely the result of the compiler trying its best to pinpoint the problem.
Regards : Douglas Wagner
Thank you for your assistance. I've got POLY2_B working as needed.
I believe your remark about invisible characters was correct. (And I did copy the code template from the manual and that is probably where that character came from).
The other errors were merely the result of the compiler trying its best to pinpoint the problem.
Regards : Douglas Wagner