; script for calling NIST and setting system time #define InvalidDataString -1 #define NIST 2 #define Redials 2 #define DialTime 45 #define WaitTime 15 #define myID s4 #define username s5 #define mypassword s6 #define dataDirectory s7 #define publicDataDirectory s8 long DDEChan0 #include "Call.WAS" #include "DDE.WAS" proc main string TimeString integer ststatus, t set aspect rxdata on set aspect display off call SetDDE ststatus= CallAndConnect(NIST) if ststatus != 0 TimeString = CaptureNISTString() assign s0, "time:" if nullstr TimeString ststatus = InvalidDataString else strcat s0, TimeString ; send string to DASWIN endif if DDEChan0 DDEPoke DDEChan0, "STATUS", s0 endif statmsg s0 else assign s0, "Couldn't call NIST" statmsg s0 endif hangup set aspect rxdata off set aspect display on waitfor "OK",5 t = $ltime + 10 breakpoint while $carrier != 0 ; Wait 10 seconds for disconnect if $ltime > t exitwhile endif endwhile endproc func CaptureNistString:String string s waitfor "*", 10 if success comgets s,2,5 comgets s, 52, 5 else assign s, "" endif return s endfunc