Drawing a line in LC7

Richard Gaskin ambassador at fourthworld.com
Sun Mar 1 14:17:17 EST 2015


Terence Heaford wrote:

 > I use the following routine to draw lines for charts in LC 6.7.3
 >
 > on drawLine x,y,x1,y1,tColor
 >    lock screen
 >    set the style of the templateGraphic to polygon
 >    create grc in me
 >    put the id of the last grc of me into tID
 >    set the forecolor of grc id tID to tColor
 >    set the points of grc id tID to x,y,x1,y1
 >    set the locked of grc id tID to true
 >    unlock screen
 > end drawLine
 >
 > When I run the project in LC 7.0.3 the lines do not draw.
 > Is there a reason for this?
 >
 > When I look in the group, all the graphics exist.

Looks like they fixed a bug in v7:

The correct format for the points property is that each point is a 
comma-separated pair, with each pair separated by CR.

Apparently older versions allowed multiple points on a single 
comma-delimited line.

If you change this:
     set the points of grc id tID to x,y,x1,y1

..to this:
     set the points of grc id tID to x,y &cr& x1,y1

..it works fine.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the Use-livecode mailing list