On 20 Jun 2009, at 09:08, John Sadler wrote:

You can do almostanything under Tptr with George's help!


I hope that anyone can use TurboPTR without my help! However I'm always willing to give help, or even change TurboPTR to make it do a bit more than "almost anything".

Thatismore than you can say for EasyPtr!

It is true that I can't help anyone with EasyPtr.

However, here's an indication of how TurboPTR gets a window to pop up. It uses the vector WM.WRPTRT which allows a timeout to be set, and also job events to be noted. The TurboPTR function using this is WRPTRP(working definition address,timeout,events). This function returns a long word showing why the function returned.

Here is a small example:

1640 REPeat lp
1650 k=WRPTRT(wwd,300,255)
1660  r=255&&get_x%(k)
1670  REMark ***************************************
1680  REMark *   r is the code extracted from k       *
1690  REMark *   255 -> a loose item                        *
1700  REMark *   254 -> an event                              *
1710  REMark *   252 -> timed out                             *
1720 REMark * *
1730  REMark *  get_y%(k) is the bottom word of k  *
1740  REMark *   and is the item or event number   *
1750  REMark ***************************************
1760  SELect ON r
1770   =255:REMark loose items
1780     IF do_loose%(get_y%(k)):EXIT lp
1790   =254:REMark event
1800     IF do_event%(get_y%(k)):EXIT lp
1810   =252:REMark timed out
1820     IF Do_Timeout%:EXIT lp
1830  END SELect
1840 END REPeat lp
1850 STOP
2080 DEFine FuNction Do_Timeout%
2090 REMark ******************************* 2100 REMark * If on a loose item * 2110 LOCal stadr,x: REMark * -> Do_Indic% * 2120 stadr=PEEK_L(wwd): REMark * ->status area * 2130 IF PEEK_W(stadr+12)<>-1:RETurn 0: REMark * Not in main window * 2140 x=PEEK_W(stadr+$30): REMark * x = loose item number (?) * 2150 IF x<0:RETurn 0:ELSE RETurn Do_Indic% :REMark * If x < 0 not a loose item * 2160 :REMark *******************************
2170 END DEFine
2530 DEFine FuNction Do_Indic%
2540 :
2550 REMark ************************************* 2560 wwd1=M_SETUP(#0,wd(x+1),-1): REMark * Set the working definition. * 2570 chid1=M_PULLD(wwd1,-1): REMark * Make the window appear. * 2580 do_sec: REMark * Process this window until . . * 2590 BUNST wwd1: REMark * . . it disappears . . * 2600 CLOS chid1: REMark * . . and its channel is closed. * 2610 BRCHP wwd1: REMark * Returns the space for working * 2620 IF acty<0:RETurn 0: REMark * definition. *
2630  IF acty=0:D_LDRW 128*65536,wwd
2640 RETurn do_loose%(acty): REMark * The action set by do_sec * 2650 REMark *************************************
2660 END DEFine

George


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to