I was surprised to not see an explicit statement in a quick scan of the
Graphics Programming in Icon book regarding using spaces in attribute
assignments. I did run Jackie's program on Linux, where it died with an
error 145 (bad window attribute, catching and complaining about the extra
spaces) and on Windows, where it ran with a wrong-size window.

Running with a wrong-size window is a bug.  Dieing with a runtime error
complaining about the spaces is a bug.  Windows and Linux not behaving the
same is a bug, and is fascinating. So, let's treat this as a bug report.
Until it is fixed, users are advised to avoid putting spaces in
attribute=value assignments.  Empirically, it appears that spaces after the
= and before any part of the value are trimmed, but not elsewhere, or not
consistently.  If we change the code to trim spaces in more places, we have
to be careful that that is safe to do for some attributes, such as label.
Spaces in a label assignment may be significant.

Clint

On Fri, Jun 24, 2011 at 11:32 AM, Jafar Al-Gharaibeh <to.ja...@gmail.com>wrote:

> Jackie,
>
>    The problem is that the opened window is not really 400x400 and that is
> because of the parameter that you are passing to WOpen(). Here is what you
> have:
>
>
> &window := WOpen("size = 400, 400")
>
> it should be:
>
>
> &window := WOpen("size=400,400")
>
> My test shows that spaces are not allowed in the text parameters for
> WOpen()/open() .
>
> Hope this helps,
> Jafar
>
>
>
>
>
> On Fri, Jun 24, 2011 at 10:19 AM, Jackie McBride <able...@gmail.com>wrote:
>
>> Ok, well, we've passed the "my code won't run" phase. But I really do
>> have a question now that pertains more about how the language works.
>>
>> Here's my code:
>> link turtle
>> link graphics
>> procedure main()
>> f := open("testing.txt", "w")
>> &window := WOpen("size = 400, 400")
>> write(f, "before drawing, x is ",TX(), " y is ", TY())
>> FillCircle(150, 150, 100)
>>
>> WriteImage("filled-circle.gif")
>> end
>>
>> & here's my output:
>> before drawing, x is 320.5 y is 96.5
>>
>> My question is this--my understanding is that I have opened a window
>> sized 400x400. My understanding is also that THome() puts the turtle
>> at the center of the screen, facing north or -90 degrees. Now, I am by
>> no means a math genius--truthfully, I suck at it--but my expectation
>> is that a window of 400x400 would have a center at 200,200, +/- a
>> pixel or so. That should make my center at 200,200, (I think THome()
>> adds .5, so that would make it 200.5 for both x & y. So why is my x
>> coordinate 320.5 & my y 96.5? I am really confused now.
>>
>> I really think it's crucial that I understand what's going on here,
>> because w/o it I can't place things accurately--that is in fact
>> already an issue. Any help appreciated. Sorry for the newbie
>> questions.
>>
>> --
>> Blame the computer--why not? It can't defend itself & occasionally
>> might even be the culprit
>> Jackie McBride
>> Jaws Scripting training materials:
>> www.screenreaderscripting.com
>> homePage: www.abletec.serverheaven.net
>>
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense..
>> http://p.sf.net/sfu/splunk-d2d-c1
>> _______________________________________________
>> Unicon-group mailing list
>> Unicon-group@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/unicon-group
>>
>
>
>
> --
> "Let there be no compulsion in religion: Truth stands out clear from error"
> [The Holy Qur'an 2:256]
>
> "Injustice anywhere is a threat to justice everywhere"    Dr. King
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense..
> http://p.sf.net/sfu/splunk-d2d-c1
> _______________________________________________
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to