*/
Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?
*/

View \DVTEST.PAS

This unit adds support for the DESQview" multi-tasking

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


Program DVTest;
uses crt, desqview;
var c : char;
begin
  IF Dv_Loaded THEN BEGIN
    ClrScr;
    Writeln('Detected DESQview version ',Hi(Dv_Version)+Lo(Dv_Version)/100:4:2);
    Writeln;
    Writeln('Beginning DESQview test.');
    Writeln;
    Writeln('First we will test the DV_Pause function.  This function gives');
    Writeln('up time slices when waiting for input.');
    Writeln;
    Writeln('We are now looping and waiting for keyboard input WITHOUT giving');
    Writeln('up time slices.  Open another window now and run SI and take note');
    Writeln('of the SI rating.');
    Writeln('PRESS ANY KEY WHEN READY');
    REPEAT UNTIL KEYPRESSED;
    c:=readkey;
    ClrScr;
    Writeln('Good, now this time we will give up time slices while waiting for');
    Writeln('keyboard input.  Open a window again and record the SI rating.');
    Writeln('It should be higher.');
    Writeln('PRESS ANY KEY WHEN READY');
    REPEAT
      Dv_Pause;
    UNTIL KeyPressed;
    c:=readkey;
    ClrScr;
    Writeln('Ok, now we will test the Dv_Begin_Critical .. Dv_End_Critical procs.');
    Writeln('Dv_Begin_Critical suspends all other tasks and they stay suspended');
    Writeln('until we do a Dv_End_Critical.  Open another window and start a task');
    Writeln('that does something.  Type a large text file for example.  Then, while');
    Writeln('that task is executing, switch back to this window and hit a key.');
    Writeln('The other task should freeze for five seconds and then resume.');
    Writeln('PRESS ANY KEY WHEN READY');
    repeat until keypressed;
    c:=readkey;
    Dv_Begin_Critical;
    Delay(5000);
    DV_End_Critical;
    Writeln('The other task should continue now.');
    Writeln;
    Writeln('End of DESQview unit test.');
  END ELSE Writeln('No DESQview!');
end.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.