teletubby5e
Technical User
I AM CERTAIN THAT I AM MISSING SOMETHING BASIC HERE ... BUT I CAN'T GET THIS SCRIPT TO COMPILE. IT ERRORS OUT ON LINE 23 SAYING "INVALID NUM". AS I AM NOT A PROGRAMMER, ANY HELP WILL BE GREATLY APPRECIATED ... THANKS! JEFF
PROC MAIN
STRING STARTNUM
STRING ENDNUM
STRING XCONN
STRING STSNUM
STRING FACTYPE
INTEGER NUM1
INTEGER NUM2
ERRORLOOP:
SDLGINPUT "ENTER" "STS OR DS3 NUMBER (i.e. 17 OR 160, etc.)" STSNUM
SDLGINPUT "ENTER" "FACILITY TYPE (T1 or VT1)" FACTYPE
SDLGINPUT "ENTER" "STARTING VT NUMBER (i.e. 1)" STARTNUM
SDLGINPUT "ENTER" "ENDING VT NUMBER (i.e. 28)" ENDNUM
;ATOI STARTNUM NUM1 ; CONVERT TO INTEGER SO WE CAN INCREMENT
;ATOI ENDNUM NUM2
MAINLOOP:
;===BEGIN SUBROUTINE
IF FACTYPE="VT1"
STRFMT XCONN "ENT-CRS-VT1::VT1-%s-%s,VT1-%s-%s:CTAG::1WAY::;" STSNUM STARTNUM STSNUM STARTNUM
ELSE
;IF FACTYPE="T1"
STRFMT XCONN "ENT-CRS-T1::%s-%s,%s-%s:CTAG::1WAY:::;" STSNUM STARTNUM STSNUM STARTNUM
ENDIF
TRANSMIT XCONN
WAITFOR "COMPL" FOREVER
STATMSG "BUILDING XCONN %s-%s-%s" STSNUM FACTYPE NUM1
MSPAUSE 250 ; PAUSES A QRTR OF A SEC
;===END SUBROUTINE
ATOI STARTNUM NUM1 ; CONVERT TO INTEGER SO WE CAN INCREMENT
ATOI ENDNUM NUM2
IF NUM2<NUM1
USERMSG "FIRST NUMBER MUST BE LESS THAN ENDING NUMBER"
GOTO ERRORLOOP
ELSE
ENDIF
NUM1++ ; ADDS 1
ITOA NUM1 STARTNUM ; CONVERT TO STRING
ITOA NUM2 ENDNUM
IF NUM1==NUM2+1 ; CK TO SEE IF COMPLETE
TRANSMIT ";"
USERMSG "COMPLETED"
HALT
ELSE
GOTO MAINLOOP
ENDIF
ENDPROC
PROC MAIN
STRING STARTNUM
STRING ENDNUM
STRING XCONN
STRING STSNUM
STRING FACTYPE
INTEGER NUM1
INTEGER NUM2
ERRORLOOP:
SDLGINPUT "ENTER" "STS OR DS3 NUMBER (i.e. 17 OR 160, etc.)" STSNUM
SDLGINPUT "ENTER" "FACILITY TYPE (T1 or VT1)" FACTYPE
SDLGINPUT "ENTER" "STARTING VT NUMBER (i.e. 1)" STARTNUM
SDLGINPUT "ENTER" "ENDING VT NUMBER (i.e. 28)" ENDNUM
;ATOI STARTNUM NUM1 ; CONVERT TO INTEGER SO WE CAN INCREMENT
;ATOI ENDNUM NUM2
MAINLOOP:
;===BEGIN SUBROUTINE
IF FACTYPE="VT1"
STRFMT XCONN "ENT-CRS-VT1::VT1-%s-%s,VT1-%s-%s:CTAG::1WAY::;" STSNUM STARTNUM STSNUM STARTNUM
ELSE
;IF FACTYPE="T1"
STRFMT XCONN "ENT-CRS-T1::%s-%s,%s-%s:CTAG::1WAY:::;" STSNUM STARTNUM STSNUM STARTNUM
ENDIF
TRANSMIT XCONN
WAITFOR "COMPL" FOREVER
STATMSG "BUILDING XCONN %s-%s-%s" STSNUM FACTYPE NUM1
MSPAUSE 250 ; PAUSES A QRTR OF A SEC
;===END SUBROUTINE
ATOI STARTNUM NUM1 ; CONVERT TO INTEGER SO WE CAN INCREMENT
ATOI ENDNUM NUM2
IF NUM2<NUM1
USERMSG "FIRST NUMBER MUST BE LESS THAN ENDING NUMBER"
GOTO ERRORLOOP
ELSE
ENDIF
NUM1++ ; ADDS 1
ITOA NUM1 STARTNUM ; CONVERT TO STRING
ITOA NUM2 ENDNUM
IF NUM1==NUM2+1 ; CK TO SEE IF COMPLETE
TRANSMIT ";"
USERMSG "COMPLETED"
HALT
ELSE
GOTO MAINLOOP
ENDIF
ENDPROC