;Script to set the CAT-1000 clock using the time of PC clock. ;Copywright 2000 Jim Hartzell WA3UQD, wa3uqd@arrl.net proc main; string dateinfo ; Date temp storage. string month ; Month of year. string day ; Day of month. string daystr ; Day of week string. string hour ; hour. string minute ; Minute. string cmd = "clck/" ; Command to be sent to CAT. integer dayweek ; Day of the week. integer dayyear ; Day of the year. integer leapyear ; Leap year flag. substr hour $TIME24 0 2 ; Get the Hour. substr minute $TIME24 3 2 ; Get the Minute. ltimemisc $LTIME DayWeek DayYear LeapYear ; Get the Day of Week Number. strcpy dateinfo $DATE ; Copy the date into the string. strtok month dateinfo "/" 1 ; Get the month. strtok day dateinfo "/" 1 ; Get the day. itoa DayWeek Daystr ; Convert day of week to a string. strcat cmd hour ; Start building command to send to the CAT. strcat cmd "," ; strcat cmd minute ; strcat cmd "," ; strcat cmd daystr ; strcat cmd "," ; strcat cmd day ; strcat cmd "," ; strcat cmd month ; Command build finished. transmit cmd ; Send the Command. transmit "^m" ; Send carriage return. waitfor "->" ; Wait until clock is set. pause 1 ; Time for CAT to think. transmit "clck^m" ; Verify time and date. endproc;