BUG: CSRLIN Can Return Incorrect Value for TEXTSIZE <> 12 (45419)






This article was previously published under Q45419

SYMPTOMS

The CSRLIN function can return the wrong value when the TEXTSIZE is set to other than TEXTSIZE 12, which is the default.

Microsoft has confirmed this to be a bug with Macintosh QuickBasic Version 1.00, Macintosh Basic Interpreter Version 3.00 (buglist3.00), and Macintosh Basic Compiler Version 1.00 (buglist1.00). We are researching this problem and will post new information as it becomes available.

When you use a TEXTSIZE other than 12, CSRLIN returns a value of (1 + actual line number) after printing the first print statement. You can work around this behavior by using the LOCATE statement to locate the first PRINT statement.

In the following code example, "Hello" and "world" should be printed on the same line, but they are not. The value for CSRLIN should be 1, but actually is 2:

Code Example

CALL TEXTSIZE(9)        ' TEXTSIZE (12) works correctly--default
' LOCATE 1,1            ' Add this line to eliminate problem.
PRINT "Hello";
oldCSRLIN%=CSRLIN
LOCATE CSRLIN, POS(0)   ' should locate at current cursor position
PRINT "world"
PRINT "CSRLIN was ";oldCSRLIN%   ' should be 1 -- actually 2
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: kbbug KB45419