[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] difference between next-listing and position



Position and next-listing both move the print position on the page.
The main difference is the position command does not change the line numbers.
Next listing moves the print position down AND ALSO changes the current line 
number (after the move) to be line 1
Position can move both up and down, but next listing can only move down.

E.g.
Position (1)
Print 'line one' (,1)
Position (+1)
Print 'line two' (,1)
Position (+1)
Print 'line three' (,1)
Position (1)
Print 'line one again' ()

Will print 
Line one  line one again
Line two
Line three

Compared to:  (changing the position (+1) to next-listing)
Position (1)
Print 'line one' (,1)
Next-listing
Print 'line two' (,1)
Next-listing
Print 'line three' (,1)
Position (1)
Print 'line one again' ()

Will print 
Line one  
Line two
Line threeline one again

The difference becomes apparent when you try to position back to line 1 again.
The next-listing command has "moved" line 1


Both methods have their advantages and disadvantages.  I usually use 
next-listing as it generally makes the printing logic simple.
But if you ever want to move up the page instead of down you need to use 
position ().
Just don't try to mix the two, although it's allowed, it's nearly impossible to 
debug a program that isn't printing right when you
have mixed both methods.

Steve.


-----Original Message-----
From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org
[mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] On Behalf 
Of Manasvini Mahajan
Sent: Monday, 23 July 2007 4:00 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] difference between next-listing and position

Hi All,

Can anyone helo me understand the difference between Positon & Next-listing 
Please help

regards
Manaswini

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users