I need to draw lines at particular slopes in two segments, where one segment may be drawn in a different color than the continuing segment. To draw the second segment, I use the standard formula for slope to determine the end point of the second line segment. Sometimes i know that point's x value in advance, sometimes its y value. The unknown value is tagged by the constant Unknown, which is set to an extremely high negative value.

The method calcPoint is defined as follows:

Sub calcPoint( x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer, ByRef x4 as integer, ByRef y4 as integer )

I call it as follows:

      (x1-x3, y1-y3 already set)
      ...
      dim x4 as integer = Unknown
dim y4 as integer = g.Height // Bottom of the canvas in which line will be drawn
      calcPoint( x1, y1, x2, y2, x3, y3, x4, y4 )

When I trace through the program in the debugger and enter the calcPoint method, I find that all of the parameters of calcPoint have their correct values EXCEPT x4 and y4, which are equal to zero! What am I doing wrong? I've never had problems with ByRef before, and must be missing something obvious right in front of my eyes.

Thanks in advance for your help.

-Scott

Scott B. Steinman, O.D., Ph.D., F.A.A.O.
Professor, Southern College of Optometry
Chair, Open Source Purely-Graphical Programming Language Initiative (www.ospgli.org) Author, "Visual Programming with Prograph CPX", Manning/Prentice- Hall, 1995 (www.manning.com/steinman). Author, "Foundations of Binocular Vision", McGraw-Hill, 2000 (books.mcgraw-hill.com/cgi-bin/pbg/0838526705.html) Brought to you by a grant from the Steinman Foundation (Thanks, Mom and Dad!)
Recommended by Major University Studies Over the Leading Brand

1245 Madison Avenue
Memphis, TN 38104-2222
steinman at sco.edu

For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken Nothing is impossible for the man who doesn't have to do it himself. -- Anonymous


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to