Help with PPL.



#8

Sorry if this has already been asked. In PPL, I am unable to clear the screen before each program run. RECT(); appears to do nothing to the 'console'. For example, from memory (emulator is at work):

EXPORT TEST();
RECT();
PRINT("Hello World");
FREEZE;
END

The result, in the 'console window', after subsequent RUNs, is:

Hello World
Hello World
Hello World
Hello World
Hello World

I thought RECT() would clear the screen. Looking for a CLEAR or NEW or DRAW(-1) command…

Regards.

Edited: 1 Nov 2013, 1:39 a.m.


#9

Quote:
Sorry if this has already been asked. In PPL, I am unable to clear the screen before each program run. RECT(); appears to do nothing to the 'console'. For example, from memory (emulator is at work):

EXPORT TEST();
RECT();
PRINT("Hello World");
FREEZE;
END

The result, in the 'console window', after subsequent RUNs, is:

Hello World
Hello World
Hello World
Hello World
Hello World

I thought RECT() would clear the screen. Looking for a CLEAR or NEW or DRAW(-1) command…

Regards.



RECT() clears the "current" screen (which is the G0 graphic variable). PRINT() draws to a different screen. I don't know which, off the top of my head.


#10

Hello,
In order to clear the terminal window from previous program run you have to add another PRINT() command like this:


EXPORT TEST();

// the next print clear the terminal window

PRINT();

PRINT("Hello World");

FREEZE;

END

Hope it helps,

Giancarlo

Edited: 1 Nov 2013, 6:24 a.m.

#11

The terminal is a special window for text messages. It is created on startup and remains hidden. When it pops up, it covers whatever is behind. Pressing ON-T (together) will bring the terminal up at any point.

Like has been said, PRINT() is the equivalent of RECT_P() and is what is used to clear the terminal.

Note that the terminal is really just meant as a convenient place to display text in a temporary way. The information there is not saved, is frequently cleared, and there is no way to get text out of it.

TW

Edited: 1 Nov 2013, 10:20 a.m.


#12

Quote:
The terminal is a special window for text messages. It is created on startup and remains hidden. When it pops up, it covers whatever is behind. Pressing ON-T (together) will bring the terminal up at any point.
TW

sorry for my bad English

>> (Pressing [ON]+[T] == terminal view) in the computer software "HP-Prime virtual" does not happens, should be fixed this BUG in future updates

Quote:
Note that the terminal is really just meant as a convenient place to display text in a temporary way. The information there is not saved, is frequently cleared, and there is no way to get text out of it.

the term (terminal) means input / output data in the future must support data input, otherwise you should rename 'TERMINAL VIEW' to 'OUT VIEW' or something

The series ti89/v200/92+ has a terminal view that no calculator has surpassed

much better if you could somehow keep this information without deleting terminal, besides retrieved by a command

showTerminalView

[request for HP-Prime TEAM]

new commands as last generation software that exceeds the primitive calculators (ti89/v200/92+): showTerminalView & readLine for terminal view ~ readln (PASCAL)

program algoritmo;
uses crt;

var hora_1, hora_2, minuto_1, minuto_2, segundo_1, segundo_2, horas, minutos, segundos : integer;
var tecla : char;
begin
write ('Ingrese el valor de hora 1: ');
readln (hora_1);
write ('Ingrese el valor de hora 2: ');
readln (hora_2);
write ('Ingrese el valor de minuto 1: ');
readln (minuto_1);
write ('Ingrese el valor de minuto 2: ');
readln (minuto_2);
write ('Ingrese el valor de segundo 1: ');
readln (segundo_1);
write ('Ingrese el valor de segundo 2: ');
readln (segundo_2);
segundos := ((hora_2-hora_1)*60+minuto_2-minuto_1)*60+segundo_2-segundo_1;
minutos := (segundos-segundos mod 60) div 60;
horas := (minutos-minutos mod 60) div 60;
minutos := minutos mod 60;
segundos := segundos mod 60;
writeln ('Valor de horas: ', horas);
writeln ('Valor de minutos: ', minutos);
writeln ('Valor de segundos: ', segundos);
writeln;
write ('Presione una tecla para terminar . . . ');
tecla := readkey;
end.

Edited: 1 Nov 2013, 10:53 a.m.

#13

Terminal is a very convenient way to display text. Many programmers start their days programming in a text editor then see their RUN results in a terminal window. For many programs this is not only convenient it is so simple it is desired. Do we need to get elaborate with our output if the program is a simple routine?

I know this is a very general question, but for simple programs what is the recommended output display method?

Regards.


#14

with readLine command on the terminal screen would read data

simulating an input


EXPORT Deducir_Numero2()
// port (version 0.0.3) to HP-Prime by compSystems, source code original by PABLO. coder ZINJAI, PSEINT : http://pseint.sourceforge.net
begin
print();
print( "*** Ejecución Iniciada. ***");
freeze; wait;
local num_ingresado:=0;
local total_intentos:=8;
local num_secreto:= ( rand() mod 100 ) + 1;

print("Adivine el numero (de 1 a 100)");
print("Ingrese el # de intentos");
freeze; wait(2);
if NOT(input(total_intentos,"Total de Intentos","Intentos=","Digite un # como total de intentos")) then kill; end;
print(">"+total_intentos);
local intentos:=total_intentos;
print("Debug: "+num_secreto);

if NOT(input(num_ingresado,"Deducir_Numero","Num Ingresado=","Digite un #")) then kill; end;
print(">"+num_ingresado);
while num_secreto <> num_ingresado and intentos>1 do

if num_secreto>num_ingresado then
print("Muy bajo");
else
print("Muy alto");
end;
intentos:=intentos-1;
print("Le quedan "+intentos+" intento(s):");
freeze; wait;
if NOT(input(num_ingresado,"Deducir_Numero","Num Ingresado=","Digite un #")) then kill; end;
print(">"+num_ingresado);
end;

if num_secreto <> num_ingresado then
print("El numero era: "+num_secreto);
else
print("Exacto! Usted adivino en: "+ ((total_intentos+1)-intentos) +" intento(s.)");
end;
print("*** Ejecución Finalizada. ***");

freeze;
return "Done";

end;


Possibly Related Threads...
Thread Author Replies Views Last Post
  My first HP Prime PPL Program Michael de Estrada 9 434 10-19-2013, 02:32 PM
Last Post: Michael de Estrada

Forum Jump: