home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / Thermometer.lzx / AmigaTemp / ARexxScr / ListAlarm.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-09-08  |  1.8 KB  |  53 lines

  1. /* AmigaTemp V1.2 ARexx  */
  2. /* Lists AlarmInfo       */
  3.  
  4. /* Start */
  5. st = Show(P, 'AmigaTemp')                 /* Is program running? */
  6. if st == 0 then                           /* No... */
  7. do
  8.    Address COMMAND                     
  9.    
  10.    'AmigaTemp CX_POPUP=NO'               /* Start AmigaTemp. Don't POPUP */
  11.    if rc > 0 then do                      /* Program not found... */
  12.       Say "Can't start AmigaTemp"
  13.       exit
  14.    end   
  15.    
  16.    do 2 while ~Show(P, 'AmigaTemp')    /* Wait until program has started or at least 20 sek */
  17.       'waitforport AmigaTemp'
  18.    end
  19.    
  20.    if ~Show(P, 'AmigaTemp') then do       /* Something is wrong... */
  21.       Say "No contact with ARexx Port"
  22.       exit
  23.    end
  24. end   
  25.  
  26. /* Main */
  27. Options RESULTS                           /* Retrive the string result field */
  28. Address 'AmigaTemp'                       /* Portname for AmigaTemp (Case sensitive) */ 
  29.  
  30. 'Version'; Say result                     /* Write name and version */
  31.  
  32. 'NumSensor'; numsensor = result           /* Number Of Sensors */
  33.  
  34. do i=1 to numsensor
  35.    'Name' i                               /* Name of sensor */
  36.    If rc == 0 then                        /* rc == 0 if sensor is connected */
  37.    do
  38.       name = result                       /* Name of sensor */
  39.       'AlarmMax'     i; max = result      /* Max temperature */
  40.       'AlarmMin'     i; min = result      /* Min temperature */
  41.       'AlarmTextMax' i; textmax = result  /* Text for max temperature */
  42.       'AlarmTextMin' i; textmin = result  /* Text for min temperature */
  43.    
  44.       Say name || ':'                     /* Write... */
  45.       Say 'Max : ' || max || ' Text : ' || textmax
  46.       Say 'Min : ' || min || ' Text : ' || textmin
  47.    end
  48. end i   
  49.  
  50. if st == 0 then 'Quit'                    /* Quit AmigaTemp if we started it */   
  51.    
  52.    
  53.