This macro work only if the session is closed???? Why?
Sub main
Dim max as long
dim nuovo as string
dim testo as string
dim lungh as integer
dim lunghezza as string
dim aggiung as integer
dim cambio as string
nuovo ="PrinterFilename"
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for input as #1
Max = LOF(1)
for i = 1 to max
seek 1,i
testo = input (15,#1)
if testo=nuovo then
seek 1,i
line input #1,lunghezza
lungh=len(lunghezza)
cambio=inputbox("nomefile")
nuovo="PrinterFilename="+cambio
exit for
end if
next i
close #1
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for append as #1
seek 1,i
aggiung=(lungh-len(nuovo))
nuovo=nuovo+space(aggiung)
print #1, nuovo
close #1
'=========================================================
nuovo ="PrinterWriteToFile"
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for input as #1
Max = LOF(1)
for i = 1 to max
seek 1,i
testo = input (18,#1)
if testo=nuovo then
nuovo="PrinterWriteToFile=1"
exit for
end if
next i
close #1
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for append as #1
seek 1,i
nuovo=nuovo
print #1, nuovo
close #1
end sub
Sub main
Dim max as long
dim nuovo as string
dim testo as string
dim lungh as integer
dim lunghezza as string
dim aggiung as integer
dim cambio as string
nuovo ="PrinterFilename"
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for input as #1
Max = LOF(1)
for i = 1 to max
seek 1,i
testo = input (15,#1)
if testo=nuovo then
seek 1,i
line input #1,lunghezza
lungh=len(lunghezza)
cambio=inputbox("nomefile")
nuovo="PrinterFilename="+cambio
exit for
end if
next i
close #1
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for append as #1
seek 1,i
aggiung=(lungh-len(nuovo))
nuovo=nuovo+space(aggiung)
print #1, nuovo
close #1
'=========================================================
nuovo ="PrinterWriteToFile"
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for input as #1
Max = LOF(1)
for i = 1 to max
seek 1,i
testo = input (18,#1)
if testo=nuovo then
nuovo="PrinterWriteToFile=1"
exit for
end if
next i
close #1
Open "C:\Programmi\Attachmate\E!E2K\Sessions\CL151F4500_PRT.EPP" for append as #1
seek 1,i
nuovo=nuovo
print #1, nuovo
close #1
end sub