After reading thread184-635869, it reminded me of something i noted once. The following produces strange (well, i think it's strange) results
CREATE CURSOR blah ( name c(10) )
FOR i = 1 TO 10
INSERT INTO blah VALUES ("blah" + ALLT(STR(i)))
NEXT
_num = 0
SELECT name, nextnum() FROM blah
FUNCTION nextnum
_num = _num + 1
RETURN _num
The first record in the query has 2, when, as best i can figure, it should be 1. The range should be 1 to 10, but instead we see 2 to 11. The first record is calculated twice, but only one record?
If this is normal, what is the reason for this? I've had to code around it once, not really a problem, but i'm somewhat curious..
Thanks
CREATE CURSOR blah ( name c(10) )
FOR i = 1 TO 10
INSERT INTO blah VALUES ("blah" + ALLT(STR(i)))
NEXT
_num = 0
SELECT name, nextnum() FROM blah
FUNCTION nextnum
_num = _num + 1
RETURN _num
The first record in the query has 2, when, as best i can figure, it should be 1. The range should be 1 to 10, but instead we see 2 to 11. The first record is calculated twice, but only one record?
If this is normal, what is the reason for this? I've had to code around it once, not really a problem, but i'm somewhat curious..
Thanks