Post Reply 
how to scroll Terminal and return to a choice?
06-29-2015, 07:37 AM (This post was last modified: 06-29-2015 12:04 PM by salvomic.)
Post: #1
how to scroll Terminal and return to a choice?
hi,
I've a long Terminal list (or a screen with TEXTOUT, long).
I need to prevent to exit from Terminal (or graphic) touching the screen (now it ends Terminal).
Otherwise it would ok a way to save Terminal "as is" in a variable...

I was use a code like this structure:
Code:

whattodo() // function with CHOOSE()
BEGIN
LOCAL ch;
CHOOSE ch;
//...
END;

// foo()
// present data in Terminal, user scroll to read all
BEGIN
//...
FREEZE();
WAIT;
whattodo();
END;

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2015, 11:04 PM (This post was last modified: 06-30-2015 06:48 AM by salvomic.)
Post: #2
RE: how to scroll Terminal and return to a choice?
for now I'm finding only a workaround:

to insert this code
Code:

WAIT();
PRINT(); // to clear the previous page of Terminal...

among the various groups of PRINT(); lines, to simulate a pagination.
But that works only if the user doesn't touch the screen, otherwise the program exit from Terminal and go on with the other commands...
Enter (or other key or paddle) is ok...

I need, however, something more stable and ...elegant, please.

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
06-30-2015, 02:53 AM (This post was last modified: 06-30-2015 03:04 AM by jkiriosd.)
Post: #3
RE: how to scroll Terminal and return to a choice?
Hi salvomic, i hope this can help you. Just ctrl+c and ctrl +v and test.

Code:

LOCAL VAR1,VAR2;VAR3;
HOJA1();
HOJA2();
HOJA3();

HOJA1()
BEGIN
PRINT();
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR1 ="+VAR1);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("USE THE ARROW KEYS TO MOVE TO THE NEXT PAGE");
PRINT("                                                                         ->");
REPEAT
K:=GETKEY;
IF K==8 THEN
RETURN HOJA2();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END
UNTIL
A==1;
END;


HOJA2()
BEGIN
PRINT();
PRINT("");
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR2 ="+VAR2);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("USE THE ARROW KEYS TO SCROLL BETWEEN PAGES");
PRINT("<-                                                                      ->");

REPEAT
K:=GETKEY;
IF K==7 THEN
RETURN HOJA1();
END;
IF K==8 THEN
RETURN HOJA3();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END
UNTIL
A==1;
END;


HOJA3()
BEGIN
PRINT();
PRINT();
PRINT("");
PRINT("");
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR3 ="+VAR3);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("TO END THE PROGRAM PRESS ESC TWO TIMES.");
PRINT("<-");

REPEAT
K:=GETKEY;
IF K==7 THEN
RETURN HOJA2();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END;
UNTIL
A==1;
END;


EXPORT TEST()
BEGIN
A:=0;
INPUT(VAR1);
INPUT(VAR2);
INPUT(VAR3);
RETURN HOJA1();
END;

I have a problem with this code, i am sure you will have the same problem soon. Is not a big problem but i hope to solved this some day.

Sorry for my bad english, i dont speak english very well.
Find all posts by this user
Quote this message in a reply
06-30-2015, 07:02 AM (This post was last modified: 06-30-2015 07:03 AM by salvomic.)
Post: #4
RE: how to scroll Terminal and return to a choice?
(06-30-2015 02:53 AM)jkiriosd Wrote:  Hi salvomic, i hope this can help you. Just ctrl+c and ctrl +v and test.

Code:

LOCAL VAR1,VAR2;VAR3;
HOJA1();
...

I have a problem with this code, i am sure you will have the same problem soon. Is not a big problem but i hope to solved this some day.

Sorry for my bad english, i dont speak english very well.

hola,
your code had some errors...
better so:
Code:

HOJA1();
HOJA2();
HOJA3();

EXPORT HOJA1()
BEGIN
LOCAL VAR1,VAR2,VAR3;

PRINT();
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR1 ="+VAR1);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("USE THE ARROW KEYS TO MOVE TO THE NEXT PAGE");
PRINT("                                                                         ->");
REPEAT
K:=GETKEY;
IF K==8 THEN
RETURN HOJA2();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END
UNTIL
A==1;
END;


HOJA2()
BEGIN
LOCAL VAR2;
PRINT();
PRINT("");
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR2 ="+VAR2);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("USE THE ARROW KEYS TO SCROLL BETWEEN PAGES");
PRINT("<-                                                                      ->");

REPEAT
K:=GETKEY;
IF K==7 THEN
RETURN HOJA1();
END;
IF K==8 THEN
RETURN HOJA3();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END
UNTIL
A==1;
END;


HOJA3()
BEGIN
LOCAL VAR3;
PRINT();
PRINT();
PRINT("");
PRINT("");
PRINT("HOLA MUNDO");
PRINT("");
PRINT("VAR3 ="+VAR3);
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("");
PRINT("TO END THE PROGRAM PRESS ESC TWO TIMES.");
PRINT("<-");

REPEAT
K:=GETKEY;
IF K==7 THEN
RETURN HOJA2();
END;
IF K==4 THEN
STARTVIEW(-7,1);
KILL;
END;
UNTIL
A==1;
END;


EXPORT TEST()
BEGIN
LOCAL VAR1, VAR2, VAR3;
// A:=0;
INPUT(VAR1);
INPUT(VAR2);
INPUT(VAR3);
RETURN HOJA1();
END;

it seems to work now. But I shall tray if something like this works also when in a program there is CHOOSE, MSGBOX or other controls that interfere with screens...

A little advice: programming don't use "all uppercase" name for variables (they could be some reserved words with the same name...)

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)