NeoValence
Technical User
hi all,
i'm working with a video generator which has a video mode query command. when the command is typed a list of 95 different video modes are displayed one mode per line in the terminal window. the captured file looks a bit like this.
63 : 1600x1200 @47.95
64 : 1600x1200 @48
65 : 1600x1200 @50
66 : 1600x1200 @59.94
ideally i would like to create an single field array of the data in the captured file. then i need to termmsg the lines of the array sequence, waitfor each of the 7 video modes i need and then use termgets to store those modes into variables to be accessed later on during the script. this is what i have thus far:
proc main
set capture query off
fopen 0 "resh.cap" CREATE TEXT ;overwrites old helpv.cap file (if any)
yield
fclose 0 ;closes the .cap file
transmit "helpv^M" ;query help for all video modes
waitfor "helpv"
if SUCCESS
capture on ;capture file mode on
set capture recordmode raw ;captures chars. as they appear in terminal
set capture file "helpv.cap" ;names capture (.cap) file
elseif FAILURE
;errormsg "Video help command not recieved!"
exit
endif
waitfor "#"
if SUCCESS
capture off
elseif FAILURE
errormsg "exiting script"
exit
endif
fopen 0 "helpv.cap" READ TEXT ; Open helpv.cap file for read only.
if SUCCESS
termmsg "resh.cap opened successfully!`r`n"
elseif FAILURE
termmsg "resh.cap open failed!"
exit
endif
can anyone help me out with this. thanks in advance.
i'm working with a video generator which has a video mode query command. when the command is typed a list of 95 different video modes are displayed one mode per line in the terminal window. the captured file looks a bit like this.
63 : 1600x1200 @47.95
64 : 1600x1200 @48
65 : 1600x1200 @50
66 : 1600x1200 @59.94
ideally i would like to create an single field array of the data in the captured file. then i need to termmsg the lines of the array sequence, waitfor each of the 7 video modes i need and then use termgets to store those modes into variables to be accessed later on during the script. this is what i have thus far:
proc main
set capture query off
fopen 0 "resh.cap" CREATE TEXT ;overwrites old helpv.cap file (if any)
yield
fclose 0 ;closes the .cap file
transmit "helpv^M" ;query help for all video modes
waitfor "helpv"
if SUCCESS
capture on ;capture file mode on
set capture recordmode raw ;captures chars. as they appear in terminal
set capture file "helpv.cap" ;names capture (.cap) file
elseif FAILURE
;errormsg "Video help command not recieved!"
exit
endif
waitfor "#"
if SUCCESS
capture off
elseif FAILURE
errormsg "exiting script"
exit
endif
fopen 0 "helpv.cap" READ TEXT ; Open helpv.cap file for read only.
if SUCCESS
termmsg "resh.cap opened successfully!`r`n"
elseif FAILURE
termmsg "resh.cap open failed!"
exit
endif
can anyone help me out with this. thanks in advance.