| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | A few questions |
On 17 Sep 96, Andrew Seeger wrote to Frank Adam --
Hi, I think I mailed you before about the ANSI graphics within your program.
This time, it's about that clock thingy :)
FA> Do the screens have to be ANSI ?
AS> Well yes and no, i did some screens for the program with The Draw, but
AS> what i want to avoid is having the screens on hard disk, as i want
Just save in C format (refer to previous message) and you will have them
hard-coded within the program!
FA> If not, then get your hands on VidMgr12.zip and with a bit of
AS> Done, will have a looksy to see what i can come up with, Vidmgr looks
AS> like something i was after.
You don't REALLY need it...
AS>> 2... A clock routine, to display the clock and continually
Find a spot in your program where it is waiting for user-input or the like
and while it is idling, make a call to the clock routine (or WHATEVER you
want done!) ... This is a snippet of my code in a user-input routine :
=== bit of code ===
// special variables
// ~~~~~~~~~~~~~~~~~
typedef void (* Idle_Ptr)(); // a pointer to a function
// prototypes
// ~~~~~~~~~~
void Idle(); // simple idle routine for Get_Input -- does nothing
int Get_Input(char *, int, Idle_Ptr = Idle, int = 0, char * = "\x00");
/* hi-tech input function :)
parameters are : 1 - string-input variable
2 - maximum length
3 - pointer to idle function
4 - echo characters on/off
5 - characters to exclude
returns : 1 - if input aborted
0 - if input finished normally
*/
void Idle() {
asm nop; // like I said -- absolutely nothing
}
int Get_Input(char *String, int Max_Length, Idle_Ptr Idle_Func, int Mode,
char *Exclude_Char) {
char Input_Char;
while (!kbhit()) (* Idle_Func)(); // call idle function while idle
while (((Input_Char = getch()) != 0x0D) && (Input_Char !=
0x03) &&
(Input_Char != 0x1B)) {
// loops while character is not \n, ^C or ESC
switch (Input_Char) {
// irrelevant input-based stuff deleted
}
while (!kbhit()) (* Idle_Func)(); // call idle function while idle
}
// then return...
}
=== end of code ===
I hope I've not trimmed any of the essentials out, but I think it's all in
there... I've used a function pointer, so I can put Get_Input() in a LIB and
just call it from any of my programs...
FA> You just call the function from where ever there is a bit of not much
FA> to do, and it should be fairly smooth. Of course if the program gets
FA> tied down somewhere for a few seconds the update will not happen, but
Just call Get_Input() with like this :
Get_Input(Input, 81, My_Idler);
where Input is the variable, 81 is the max. length and My_Idler is your
function (N.B. "My_Idler", not "My_Idler()" !!!).
FA> in most cases it's more than adequate. Only better solution i thought
FA> of at the time, was to hook int08 or 1C but i never got around to play
FA> with it. I wonder if the CMOS could be used directly too...anyone
FA> ???
Yuppers -- like me
Chow.
Junyer Hakker.
--- PPoint 2.00
* Origin: Junyer's Workshop (3:640/772.3)SEEN-BY: 50/99 620/243 623/630 640/201 206 216 217 222 230 238 254 297 305 SEEN-BY: 640/309 370 375 386 531 535 547 739 750 772 773 820 821 822 823 890 SEEN-BY: 640/895 937 711/401 409 410 413 430 808 809 932 934 712/515 713/888 SEEN-BY: 714/906 800/1 @PATH: 640/772 531 201 820 711/409 808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.