COD =PRINTA NUME =Lansare imprimare APLIC= EXPL1=Varianta generala EXPL2= EXPL3= EXPL4= DESCH=D CMD = // PRINTA - Utilitar imprimare - Lansare imprimare paralela // // In cadrul aceluiasi apel "Utilitar de imprimare" // pentru comunicarea intre pachete sint accesibile variabilele // globale X_1, X_2, ..., X_9. // La parasirea utilitarului valorile se pierd. // // Inainte de apel se creeaza vectorul h_gcmdparam cu urmatoarele elemente: // // h_gcmdparam[ 1] - C, 6: cod pachet, ex:PRINTx, // h_gcmdparam[ 2] - L : rezultatul operatiei de listare, // la intrare valoarea este .T., // pentru iesire se poate seta in script .T. sau .F. // h_gcmdparam[ 3] - C, 8: cod lista, // h_gcmdparam[ 4] - C, n: drive + cale + nume fisier lista, // h_gcmdparam[ 5] - C,25: denumire lista, // h_gcmdparam[ 6] - C,10: cod imprimanta, // h_gcmdparam[ 7] - C,10: cod hartie, // h_gcmdparam[ 8] - D : data // h_gcmdparam[ 9] - C, 5: ora, hh:mm h_MesHlp ("Asteptati !") x_os := RTRIM(UPPER(GETENV("OS"))) x_crlf := CHR(13)+CHR(10) x_lcmd := "PRINT "+h_gcmdparam[4] #IF EMPTY(h_gcmdparam[ 6]) h_MesErr("Cod imprimanta absent !",0) #ELSEIF x_os == "LINUX" h_DOS(x_lcmd+"> NUL") h_MesHlp("Lansat imprimare "+RTRIM(h_gcmdparam[3])+" pe "+RTRIM(h_gcmdparam[ 6]),0) #ELSEIF TYPE("FIL_SCAT") = "N" // daca variabila scat nu este prezenta (exe mai vechi), // daca scat nu este definit, // daca catalog scat este vid, // atunci TYPE("FIL_SCAT")#"N" s_lst := "" h_OpenInp(h_gcmdparam[4]) h_OpenOut(h_AddPath(RTRIM(h_gcmdparam[3])+".LST",h_FilePathes[fil_scat])) #WHILE h_GetLine(@s_lst) h_PutLine(s_lst) #ENDDO h_CloseInp() h_CloseOut("") h_MesHlp("Lansat imprimare "+RTRIM(h_gcmdparam[3])+" pe "+RTRIM(h_gcmdparam[ 6]),0) #ELSEIF x_os = "LINUX_TS" // catalog spooler implicit s_lst := "" h_OpenInp(h_gcmdparam[4]) h_OpenOut(h_AddPath(RTRIM(h_gcmdparam[3])+".LST","U:\RW\SPOOL\")) #WHILE h_GetLine(@s_lst) h_PutLine(s_lst) #ENDDO h_CloseInp() h_CloseOut("") h_MesHlp("Lansat imprimare "+RTRIM(h_gcmdparam[3])+" pe "+RTRIM(h_gcmdparam[ 6]),0) #ELSEIF x_os = "WINDOWS_NT" x_fbat := h_TruePath(h_FilePathes[fil_tmp]+"FISBAT"+h_StatId()+".BAT") x_flst := h_TruePath(h_FilePathes[fil_tmp]+"FISLST"+h_StatId()+".LST") // -combinatii posibile // cu PAUSE in bat si START /WAIT // fara PAUSE in bat si START /MIN /WAIT x_lcmd := IF(FILE("PRINT.BAT"),"CALL ","")+x_lcmd MEMOWRIT(x_fbat, ; "CLS"+x_crlf+ ; x_lcmd+" > "+x_flst+x_crlf+; "EXIT"+x_crlf) h_DOS("CMD /C START /MIN /WAIT "+x_fbat) // h_ViewFile (x_flst,h_GCmdParam[4],80,60) FERASE(x_flst) FERASE(x_fbat) h_MesHlp("Lansat imprimare "+RTRIM(h_gcmdparam[3])+" pe "+RTRIM(h_gcmdparam[ 6]),0) #ELSE h_DOS(x_lcmd+"> NUL") h_MesHlp("Lansat imprimare "+RTRIM(h_gcmdparam[3])+" pe "+RTRIM(h_gcmdparam[ 6]),0) #ENDIF