'**** HEADER ************************************************************
'EXDOS03.PF3 (release .02)
'Copyright (c) 1990-1991 Applied Resource Technologies, Inc.
'P.O. Box 64381, Dallas, Texas 75206 U.S.A. (214) 855-0449
'Description: Demonstrates eqlist()
'**** FUNCTION DECLARATIONS *********************************************
'library
external progress() eqlist() diskleft() popuplist()
'core
'**** VARIABLE DECLARATIONS *********************************************
'library
public ptstr psa
'core
'**** CODE **************************************************************

local k_str ser# par# comm_str err_msg i

load "\smartii\poptools\lib\displib.psl" in-memory

progress(fgpleasing,bgpleasing,"Determining communications ports available",0)

load "\smartii\poptools\lib\doslib.psl" in-memory
load "\smartii\poptools\lib\uintlib.psl" in-memory

if eqlist("sp") < 0
     err_msg = "Not able to verify peripherals"
     jump err_exit
end if

ser# = value(group(ptstr,1))
par# = value(group(ptstr,2))

if ser#+par# = 0
     err_msg = "No communications ports available"
     jump err_exit
end if

for i = 1 to ser#
     comm_str = comm_str & group("COM1: COM2: COM3: COM4:",i)
end for

for i = 1 to par#
     comm_str = comm_str & group("LPT1: LPT2: LPT3:",i)
end for

comm_str = trim(comm_str)

screen shortrestore psa

if popuplist(8,35,15,comm_str,"Printer",1,1) = 0
     message "you have chosen to print to" & ptstr
end if

jump done

label err_exit
     screen shortrestore psa
     beep
     progress(fgerror,bgerror,err_msg,0)
     message "Press any key to exit"
label done

unload "uintlib.psl"
unload "doslib.psl"
unload "displib.psl"

