HP Forums
PRINT EXPR FILE sometimes stalls Android calculator (Actually, PRINT does) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: PRINT EXPR FILE sometimes stalls Android calculator (Actually, PRINT does) (/thread-4692.html)



PRINT EXPR FILE sometimes stalls Android calculator (Actually, PRINT does) - StephenG1CMZ - 09-09-2015 10:27 PM

Doing PRINT(EXPR(FILE)) stalls the Android calculator on some files.
I believe a setting may have changed as it used to work.
Warning: the Android calculator requires a virtual Menu/Exit - on and ESC are ineffective. The effect on a real calculator is unknown.
Code:

EXPORT BUGSTALL()
BEGIN
 LOCAL FF:="Programs(""Z_EDITOR_V0_2_RECOVERED"")";
 PRINT();
 PRINT(FF);
 WAIT;
 PRINT(EXPR(FF));
 PRINT("NEVER REACHED");
END;
Examples of files known to cause problems (either using this example code or my Z EDITOR) include the Z editor itself and CONWAY (the cut and paste version).

When using similar code within Z EDITOR, it used to work, but now doesn't.
I have tried virtual Menu/Calculator/Reset, losing all my files, but the problem remains.

Is a better Reset available?
Is anyone else seeing this stall?

[Note: testing Z Editor on itself was done using a different filename - not recursively]


RE: PRINT EXPR FILE sometimes stalls Android calculator - StephenG1CMZ - 09-16-2015 10:10 AM

Actually, on checking the above test code, there should be a PRINT(); statement to clear the Terminal before printing NEVER REACHED, without which the NEVER REACHED Will never be seen because Terminal doesn't scroll to show last line.

Inserting that has no effect on the bug.


RE: PRINT EXPR FILE sometimes stalls Android calculator - StephenG1CMZ - 09-16-2015 01:15 PM

I now suspect that the cause is not a configuration issue, nor is it dependent on EXPR trying to parse specific content in specific files.

I now think that PRINT fails when given more than 2 KB to print.

This test reproduces the same stall without requiring EXPR or file access:
Warning: requires a virtual calculator exit. Effect on real calculator unknown.
Code:

EXPORT BUGSTALL_ALT()
BEGIN
 LOCAL LF:=CHAR(10);
 LOCAL EFF:="";
 PRINT();
 FOR I FROM 1 TO 240 STEP 1 DO
  EFF:=EFF+"LINE "+I+LF;
END;

 PRINT(SIZE(EFF));
 WAIT;
 PRINT(EFF);
 PRINT();
 PRINT("NEVER REACHED");
END;

at 239 lines, the size of the string is just less than 2 KB.
Increasing to 240 lines, NEVER REACHED is never reached.

The program files that were revealing the bug were 214 lines, but those lines were longer than in this test program.


RE: PRINT EXPR FILE sometimes stalls Android calculator - StephenG1CMZ - 09-16-2015 01:41 PM

It's the size of the individual PRINT that counts, not the total amount printed to Terminal.
Dividing the PRINT into two small PRINTs avoids the stall.