At 11:42 AM -0700 7/17/02, you wrote:
>In conjunction with my SkySVG project, some items that beg the question
>"Which is best?" Meaning, "best" from a speed and efficiency perspective.
>
>1. Accessing character ranges
>
>lsRAh = lsInputLine.char[6..9]
>
>-OR-
>
>lsRAh = chars(lsInputLine, 6, 9)
>
>-OR-
>
>lsRAh = char 6 to 9 of lsInputLine

In my experience,
the above 3 syntax versions should all yield roughly the same performance -
the text access cycles basically overwhelm any syntax execution differences.

& you might try looking into .ref to possibly speed up the text access.

personally, I'd use version 1 (modern dot syntax format)

>2. Returning two values from a function
>
>on plotFunc pfRAdeg, pfDEdeg
>   -- calculations for lfPlotRA and lfPlotDE
>   return point(lfPlotRA, lfPlotDE)
>end
>
>lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
>lfPlotRA = lpPlotRADE.locH
>lfPlotDE = lpPlotRADE.locV

this returns a point & then the values have to be re-accessed (trivially)

>-OR-
>
>on plotFunc pfRAdeg, pfDEdeg
>   -- calculations for lfPlotRA and lfPlotDE
>   return [lfPlotRA, lfPlotDE]
>end
>
>lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
>lfPlotRA = lpPlotRADE[1]
>lfPlotDE = lpPlotRADE[2]

this trims the point re-access part a bit -
if the two return items are not being used as a point, then I like this method.

>-OR-
>
>on plotFunc pfRAdeg, pfDEdeg
>   -- calculations for lfPlotRA and lfPlotDE
>   return [#h: lfPlotRA, #v: lfPlotDE]
>end
>
>lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
>lfPlotRA = lpPlotRADE.h  -- or lpPlotRADE[#h]
>lfPlotDE = lpPlotRADE.v  -- or lpPlotRADE[#v]

this seems way like unnecessary work (& uses slightly more memory)


Conclusion:
1a, because I like dot syntax
2b, UNLESS these values are being used as a point, in which case I'd 
return a point.

hth

-Buzz

>Christopher Watson
>[To remove yourself from this list, or to change to digest mode, go 
>to http://www.penworks.com/lingo-l.cgi  To post messages to the 
>list, email [EMAIL PROTECTED]  (Problems, email 
>[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
>programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to