MyFlight
Technical User
- Feb 4, 2002
- 193
Help, I am trying to setup a script for a Siemens 9006 switch to automatically download traffic files.
These Files have a suffix of the Day of the study (i.e. BELINI.01, is the BELINI file for the 1st of January). I have a script file that I wrote below. The first round goes ok, however when I need to increment the suffix (01) by one is where I encounter problems. since this needs to be a 2 digit number between 01 and 31. Any number below 10 causes problems.
In addition the script file does not stop at the required point.
string sNumberDays, sStartDate, sStartDay
string sBelini = "export saved -f BELINI."
string sBiText = "export saved -f BI_01."
string sMdText = "export saved -f MD."
string sTgacc = "export saved -f TGACC."
string sEnter = "^M"
integer i, iNumberDays, iStartDay
proc main
sdlginput "Study Duration in Days" "Enter the Number of Days" sNumberDays
sdlginput "Start Date" "Enter the Start Date of the Study:" sStartDate
sdlginput "Day Started" "Enter Number of Day the Study STARTED:" sStartDay
i = 0
while 1
transmit "^M"
waitfor "LtCmd" FOREVER
transmit "list saved^M"
waitfor "LtCmd" FOREVER
for i = i upto iNumberDays ;INCREMENTS the (DAY) Date of the Study
strcat sBelini sStartDay
strcat sBiText sStartDay
strcat sMdText sStartDay
strcat sTgacc sStartDay
strcat sBelini sEnter
strcat sBiText sEnter
strcat sMdText sEnter
strcat sTgacc sEnter
transmit sBelini
waitfor "LtCmd" FOREVER
transmit sBiText
waitfor "LtCmd" FOREVER
transmit sMdText
waitfor "LtCmd" FOREVER
transmit sTgacc
waitfor "LtCmd" FOREVER
atoi sStartDay iStartDay
iStartDay++
itoa iStartDay sStartDay
endfor
endwhile
endproc
The Files I am currently trying to download are:
BELINI.05, BELINI.06, BELINI.07
BI_01.05, BI_01.06, BI_01.07
MD.05, MD.06, MD.07
TGACC.05, TGACC.06, TGACC.07
The command to download is as follows (for the BELINI.05 file):
export saved -f BELINI.05
Any and all assistance will be greatly appreciated.
These Files have a suffix of the Day of the study (i.e. BELINI.01, is the BELINI file for the 1st of January). I have a script file that I wrote below. The first round goes ok, however when I need to increment the suffix (01) by one is where I encounter problems. since this needs to be a 2 digit number between 01 and 31. Any number below 10 causes problems.
In addition the script file does not stop at the required point.
string sNumberDays, sStartDate, sStartDay
string sBelini = "export saved -f BELINI."
string sBiText = "export saved -f BI_01."
string sMdText = "export saved -f MD."
string sTgacc = "export saved -f TGACC."
string sEnter = "^M"
integer i, iNumberDays, iStartDay
proc main
sdlginput "Study Duration in Days" "Enter the Number of Days" sNumberDays
sdlginput "Start Date" "Enter the Start Date of the Study:" sStartDate
sdlginput "Day Started" "Enter Number of Day the Study STARTED:" sStartDay
i = 0
while 1
transmit "^M"
waitfor "LtCmd" FOREVER
transmit "list saved^M"
waitfor "LtCmd" FOREVER
for i = i upto iNumberDays ;INCREMENTS the (DAY) Date of the Study
strcat sBelini sStartDay
strcat sBiText sStartDay
strcat sMdText sStartDay
strcat sTgacc sStartDay
strcat sBelini sEnter
strcat sBiText sEnter
strcat sMdText sEnter
strcat sTgacc sEnter
transmit sBelini
waitfor "LtCmd" FOREVER
transmit sBiText
waitfor "LtCmd" FOREVER
transmit sMdText
waitfor "LtCmd" FOREVER
transmit sTgacc
waitfor "LtCmd" FOREVER
atoi sStartDay iStartDay
iStartDay++
itoa iStartDay sStartDay
endfor
endwhile
endproc
The Files I am currently trying to download are:
BELINI.05, BELINI.06, BELINI.07
BI_01.05, BI_01.06, BI_01.07
MD.05, MD.06, MD.07
TGACC.05, TGACC.06, TGACC.07
The command to download is as follows (for the BELINI.05 file):
export saved -f BELINI.05
Any and all assistance will be greatly appreciated.