Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen to file

Status
Not open for further replies.

yesilkalem

IS-IT--Management
Aug 4, 2001
26
0
0
TR
hello ..

I have a terminal that does not allow (permanent) capture. in stead, I have to screen to file each time I tranmit enter (for each page).

what's the screen to file command for aspect script language ?

thanks by now .
 
Hello.

I'm not sure that this is the right answer to your question but this code example may help you ( I think and I hope ;-) ).

#include "PW5MENU.INC"
proc main
set capture file "file.cap" ; Set name of capture file.
while 1
; Process data and whenever capture
; must be done call the proc
; "ScreenToCaptureFile"
endwhile
endproc

proc ScreenToCaptureFile
capture on ; Open up the capture file.
menuselect PWMENU _5SCREEN_TO_CAP ; Menu item to send screen to capture file
capture off ; Close the capture file.
endproc
 
You can use the snapshot command to capture just the current screen to a file. If you need to save more than just one screen at a time, which it sounds like to me, then you will want to use the capture command.
 
sorry
I use procom 4.8 and this script couldnt find the pw5menu.inc file. instead I know pw4menu.inc, but I couldnt find this and vkeys.inc file. perhaps i removed them and I cant find the setup cd.

can anyone send these two files or a site to download.


thanks.
 
If you don't have the files "PW4MENU.INC" or "PW4MENU.INC" you could exclude the include statement and use the constant 212 instead of _4SCREEN_TO_CAP or _5SCREEN_TO_CAP.
 
hello

thank you very much.. but my line number is more than 250 I have to assign integer term . but I couldnt manage ..

bye .


proc main
string Fname = "c:\my documents\CIFTE.txt"
string authcode [250]
string Line
integer Counter = 0
fopen 0 Fname READ TEXT
while not feof 0
fgets 0 Line
Authcode [Counter]=Line
Counter++
transmit "1^M"
transmit Line RAW
transmit "^M"
pause 4
call screentofile
transmit "^M"
pause 2
transmit "^M"
pause 2
transmit "^M"
pause 1

endwhile
endproc

#include "PW5MENU.INC"
proc screentofile
capture on ; Open up the capture file.
menuselect PWMENU _5SCREEN_TO_CAP ; Menu item to send screen to capture file
capture off ; Close the capture file.
endproc



proc wait
waitfor "tarih"
if failure
call screentofile
else
transmit "^M"
endif
endproc
 
Are you saying that you need to read more than 250 lines from your text file (CIFTE.txt)? It appears that the maximum elements in a single-dimensional array is 256, so I think you are out of luck there. However, it doesn't look like you are referencing the Authcode array anywhere in your script, except where you assign the value of Line to an element of Authcode. Can you just remove the Authcode array entirely from your script, or do you use that data somewhere else?
 
yes approximately I have 2000 line .. these are my customers id number and data is changing permanently. I need to read changing data every day.
but I nearly solved the problem I think.

I wrote one more script like this :
it reads the line but when writing data to the terminal screen it has no use .. terminal screen gives me data about the written customer (number) which the script didnt start. and while script is working I receive the same customers data 2000 times !

proc main
string sLine

fopen 0 "c:\my documents\customers.txt" READ TEXT
while not feof 0

transmit "1"
transmit "^M"
pause 1
transmit "^[E"
pause 1
fgets 0 sLine
termwrites sLine

pause 1
transmit "^M"
pause 3
call screentofile
transmit "^M"
pause 3
transmit "^M"
pause 3
transmit "^M"
pause 3

endwhile
fclose 0
endproc


#include "PW5MENU.INC"
proc screentofile
capture on ; Open up the capture file.
menuselect PWMENU _5SCREEN_TO_CAP ; Menu item to send screen to capture file
capture off ; Close the capture file.
endproc







thanks !
 
I think if you change the termwrites command to a transmit command, then everything should work for you. The termwrites command just writes the text to the terminal screen, while the transmit command sends the data to the remote system. Let me know if that does not fix the problem.
 
thank you knob and liebknecht .. I finally could write the right script. That wouldnt be without you. I appreciate you
and with tek-tips and you I'm on the way of being an advanced of procomm plus scritps.

THANK YOU VERY MUCH
this is the last situation of my script.
proc main
string sLine
integer therow = 1


fopen 0 "c:\my documents\CIFTE.txt" READ TEXT
while not feof 0

transmit "1"
transmit "^M"
pause 1
transmit "^[E"
pause 1
fgets 0 sLine
termputs therow 1 sLine
therow++


pause 14
transmit "^M"
pause 3
call screentofile
transmit "^M"
pause 3
transmit "^M"
pause 3
transmit "^M"
pause 3

endwhile
fclose 0
endproc


#include "PW5MENU.INC"
proc screentofile
capture on ; Open up the capture file.
menuselect PWMENU _5SCREEN_TO_CAP ; Menu item to send screen to capture file
capture off ; Close the capture file.
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top