Program Test; {BJ Gleason, The American University} uses portfolio; {Portfolio and some CRT routines} Const SingleLine = 0; DoubleLine = 1; var title, menu, default, temp, t : string; Xpos, Ypos, BotX, BotY, Size, pick,x : integer; p : string; c: char; begin writeln('Press a key...'); repeat until keypressed; c:=readkey; ClrScr; writeln('Test of The Portfolio Unit, Version 1.0'); if IsPort then Writeln('Running on Port') else writeln('Running on PC'); if Not IsPort then begin Writeln('Aborting...'); exit; end; PortInitialization; write('Dialing...'); t := '1-201-555-1234'; Writeln(t); PortDial(t); PortOff; Write('Tick Speed is ',PortGetTickSpeed,', '); Write('Screen Mode is '); Case PortGetDisplayMode of 0 : Writeln('Static'); 1 : Writeln('Normal'); 2 : Writeln('Tracked'); end; Writeln('Internal Disk = ',PortGetSizeInternalDisk,'k'); writeln('Rom Version ',PortRomVersion:1:3); PortErrorWindow(3,3,'Press Any Key...'); title := 'Demo Menu'; menu := 'Choice 0'+chr(0)+'Choice 1'+chr(0)+'Choice 2'+chr(0)+ 'Choice 3'+chr(0)+'Choice 4'; default := chr(0); { no defaults } Xpos := 20; Ypos := 1; BotX := Xpos; BotY := Ypos; size := PortBoxAreaCalculation(BotX,BotY,title,menu,default); writeln('Menu Requires ',size,' bytes '); { save the screen under the menu } PortScreenSaveAndRestore(Xpos,Ypos,botx,boty,0,p); pick := PortMenu(Xpos,Ypos,DoubleLine,8,0,0,title,menu,default); str(pick, temp); PortErrorWindow(Xpos-10,Ypos+pick,'You picked '+temp); { restore the screen under the menu } PortScreenSaveAndRestore(Xpos, Ypos ,botx,boty,2,p); PortStatusLine(0,7,1); { display the status line } { create a move window as the tones play } for x:= 41 to 61 do Begin Xpos := x - 41; Ypos := 3; Botx := Xpos; Boty := Ypos; { The extra spaces in 'Listen' are for the number } size := PortBoxAreaCalculation(Botx, Boty,'','Listen ',''); PortScreenSaveAndRestore(Xpos,Ypos,botx,boty,0,p); Str(x,temp); PortMessageWindow(Xpos,Ypos,'','Listen '+temp); PortSound(x, 15); PortScreenSaveAndRestore(Xpos,Ypos,botx,boty,2,p); end; PortStatusLine(0,7,0); { turn off the status line } GotoXY(0,7); { Move to the bottom of the screen } Writeln('Done'); end.