>LOCAL lcpamount, lcprntname, ncount, lcprn >lcprntname = "" >lcPart1 = "" >lcPart2 = "" >lcNetwork = "" >lcLocal = "" >lcnetc = "" >lclocalc = "" >nline = 1 > >APRINTERS(aprnt) &&& Get list of Printers >lcpamount = ALEN(aprnt) &&& Find how many items in Array > >FOR ncount = 1 TO lcpamount > lcprn = ALLTRIM(aprnt(ncount)) > IF nline = 1 > lcPart1 = ALLTRIM(lcprntname) +" " +ALLTRIM(lcprn) > nline = 2 &&& The next information will be Part 2 of the String > ELSE > IF LEFT(lcprn,1) = "\" > lcNetwork = lcPart1 + " Attached to " + lcprn +CHR(13) +CHR(10) > &&& Create a line feed & Carrage return > lcNetc = lcNetc + lcNetwork > &&& String for the Network information > ELSE > lcLocal = lcPart1 + " Attached to Port " + lcprn +CHR(13) +CHR(10) > &&& Create a line feed & Carrage return > lcLocalc = lcLocalc + lcLocal > &&& String for the Local information > ENDIF > nline = 1 &&& Go back to get part one of the string > ENDIF >ENDFOR > >THISFORM.pageframe1.page2.edtPDIR.VALUE=ALLTRIM(lcLocalc) && Populate all Local Printers >THISFORM.pageframe1.page2.edtPNET.VALUE=ALLTRIM(lcNetc) && Populate all Network Printers>