Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
128 user(s) are online (108 user(s) are browsing Forums)

Members: 1
Guests: 127

trixie, more...

Support us!

Headlines

 
  Register To Post  

« 1 (2)
Re: Help with Arexx Script
Home away from home
Home away from home


See User information
@xenic

It does work to an extent, but it won't return to the part in the script where it was SIGNALed. I guess this is some kind of emergency switch.

Anyway, it doesn't do exactly what i want it to do.

I want to call a recurring conversion which is called at least two times with the exact same lines and after processing return to the script after that "macro" was called.

Have to take a look to the other examples

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@nbache

Opps, I'm not really into arexx and mess it up frequently which is why I do most scripts in dos or python (which is far easier to learn for the simple stuff I do).

I've never used ^ or even ** in a rexx script, I was mangling basic code as a basis for that example and it shows

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Help with Arexx Script
Home away from home
Home away from home


See User information
@Severin

Thanks, the CALL did it

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@Raziel
Sorry. I interpreted your request for a "jump" command to mean that you were looking for a "goto" command that would jump to another section of code without returning. I think the "CALL" command that others suggested it what you're looking for.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Help with Arexx Script
Home away from home
Home away from home


See User information
@AREXX gods

Ok gang, here is a new problem: (Comments greatly appreciated)

I wrote myself a script which can display the temperatures and actual condition of my heatpump by polling the respective html page from it's firmware and ripping out the stuff i need.

- The script below works
- It has a 10 second polling timer for testing purposes (i want to put it into network startup once it's stable and set the polling to a minute)
- The Ringhio display works fine (abeit 160 chars with Notification is rather limited)

Problems:
The first run is silent with no errors or output
EVERY rerun in the loop however produces these errors

28 *-* READLN(WP_read);
+++ 
Command returned 20
... as many as READLN() commands are performed
       38 
*-* READLN(WP_read);
+++ 
Command returned 20
...
       
49 *-* READLN(WP_read);
+++ 
Command returned 20
...
       
58 *-* READLN(WP_read);
+++ 
Command returned 20
...
       
73 *-* READLN(WP_read);
+++ 
Command returned 20
...
       
84 *-* READLN(WP_read);
+++ 
Command returned 20
...
       
93 *-* READLN(WP_read);
+++ 
Command returned 20

and i don't understand why?

Why does it work the first run, but not the following?
Do i have an error on the file handling somewhere?
Did i forget to initialize something properly?

For now i have set OPTION FAILAT 21 to silence the warnings, but i fear they might bite me later on.

/*  $VER: WP_Auslesen.rx 0.3 (01.10.2018) Script to read out temperatures from water-water heatpump DIMPLEX WI 14 TE © Raziel

0.3
 - Addition: Introduced a permanent Notification message (limited to 160 chars)
0.2
 - Change: Switch to cURL
 - Addition: More error-proof output
0.1
 - Initial version

TODO: Make it an option to display either by Notification or CLI

*/

/* For some reason the READLN() command produces RC 20 fails on every rerun */
OPTIONS FAILAT 21

DO FOREVER
    ADDRESS COMMAND 
"cURL -s http://192.168.178.81/http/index/h_op ... ;> T:WP_Data.html"

    
i=1
    OPEN
(WP_read,'T:WP_Data.html','R')

    DO WHILE 
500
        
DO WHILE 136
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line
        SAY "Wärmepumpe Dimplex WI 14 TE"
        SAY "Die Außentemperatur beträgt:" COMPRESS(SUBSTR(working_line,20,4),"<>") "°C" */
        
ATemp=COMPRESS(SUBSTR(working_line,20,4),"<>")
        
        DO WHILE 
156
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line
        SAY " "
        SAY "Heizung"
        SAY "Die Rücklaufsolltemperatur beträgt:" COMPRESS(SUBSTR(working_line,20,4),"<>") "°C" */
        
HSTemp=COMPRESS(SUBSTR(working_line,20,4),"<>")

        DO WHILE 
162
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line
        SAY "Die Vorlauftemperatur beträgt:" COMPRESS(SUBSTR(working_line,20,4),"<>") "°C" */
        
HVTemp=COMPRESS(SUBSTR(working_line,20,4),"<>")

        DO WHILE 
245
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line */
        
IF SUBSTR(working_line,48,1) = 0 THEN DO
/*            SAY "Aktuell läuft die Heizung NICHT!" */
            
HRun="NICHT!"
        
END
        
ELSE DO
/*            SAY "Aktuell läuft die Heizung!" */
            
HRun="!"
        
END

        
DO WHILE 457
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line
        SAY " "
        SAY "Warmwasser"
        SAY "Die Solltemperatur des Warmwassers beträgt:" COMPRESS(SUBSTR(working_line,20,4),"<>") "°C" */
        
WSTemp=COMPRESS(SUBSTR(working_line,20,4),"<>")

        DO WHILE 
471
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line
        SAY "Die aktuelle Temperatur des Warmwassers beträgt:" COMPRESS(SUBSTR(working_line,20,4),"<>") "°C" */
        
WITemp=COMPRESS(SUBSTR(working_line,20,4),"<>")
        
        DO WHILE 
485
            READLN
(WP_read)
            
i=i+1
        END
        working_line
=READLN(WP_read)
/*        SAY working_line */
        
IF SUBSTR(working_line,48,1) = 0 THEN DO
/*            SAY "Aktuell wird KEIN Warmwasser bereitet!" */
            
WHeat="NICHT"
        
END
        
ELSE DO
/*            SAY "Aktuell wird Warmwasser bereitet!" */
            
WHeat=""
        
END
        i 
501
    END
    
    CLOSE
(WP_Read)
    
ADDRESS COMMAND "Delete T:WP_Data.html"

    
Notification_Message="Außentemperatur: "ATemp" °C         Heizung läuft "HRun"            (Soll: "HSTemp" °C - Ist: "HVTemp" °C)   Warmwasser wird "WHeat" bereitet! (Soll: "WSTemp" °C - Ist: "WITemp" °C)  "

    
ADDRESS RINGHIO
    
'REGISTERAPP APP=DIMPLEXWI14TEINFO ICON="SYS:Documentation/Ringhio/rx_testringhio.rexx" Dimplex WI 14 TE Information'
    'RINGHIO APP=DIMPLEXWI14TEINFO UPDATE PRI=10 IMG=SYS:Prefs/Presets/Ringhio/test.png IMGVALIGN=1 NOLOG TITLE="Dimplex WI 14 TE Information" BACKRXMSG="URL:http://192.168.178.81"' 
Notification_Message

    ADDRESS COMMAND 
"wait 10"
END

EXIT 0



And finally a bonus question:

The reason why i break the loop without reading the file to the end is because on line 691 i ALWAYS get a requester telling me i have to assign or mount this to go on
Quote:

<td><strong><script>document.write(SoftwarestandKuehlen);</script>:</strong></td>

I don't understand why the OS should jump in with this line?

I checked the source file and this is the ONLY place where a ":" exists between two "><".
But if the OS tries to mount such, it is clearly a bug (Workbench or AREXX)

I also don't understand why it should happen on a simple READLN() (I do, to enhance the counter)
(Yes, i had the main loop running with DO WHILE EOF(WP_Read) < 1 for a long time until this problem occured)

And finally, if anyone wants to check with original data, here is an example of the site:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- 
h12 27.03.2013 -->
<
html>
<
head>
<!--
tagparser="/pcotagfilt"-->
  <
meta http-equiv="refresh" content="180;URL=h_operatingdata.html">
  <
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <
link rel="SHORTCUT ICON" href="../index_img/favicon.ico">
  <
link rel="stylesheet" type="text/css" href="../style/styles.css">
  <
title>diagnostic</title>
  <
script type="text/javascript" src="../script/javascript_757c080409.js"></script>
  <
script type="text/javascript" src="../script/language.js"></script>
</
head>
<
body>
<
script type="text/javascript" language="JavaScript" src="../script/pagefunctions.js"></script>
<
a name="oben"></a>
<
div class="logo"><a id="link" href=><img id="logo" src="../index_img/logo.gif" border="0" heightwidthalt=></a>
<
script type="text/javascript">
document.getElementById('link').href=Linkadresse;
document.getElementById('logo').alt=Logo;
document.getElementById('logo').height=LogoH;
document.getElementById('logo').width=LogoW;
</
script>
</
div>
<!-- 
logo -->
<
div class="sprachen">
<
a>
<
script>var date=new Array(3);
            
date[0]=9;
            
date[1]=3;
            
date[2]=18;
            
date[3]=("20");
            for (
i=0;i<3;i++) {if (date[i]<10date[i]="0"+date[i]}
            var 
date1=date[0]+"."+date[1]+"."+date[3]+date[2];
            
document.writeln(date1);</script>&nbsp;
       <
script>var time=new Array(2);
            
time[0]=10;
            
time[1]=6;
            for (
i=0;i<2;i++) {if (time[i]<10time[i]="0"+time[i]}
            var 
time1=time[0]+":"+time[1];
            
document.writeln(time1);</script>
       <
script>document.writeln(Uhr);</script>
</
a>
</
div>
<
div class="weisserkasten">
<
div class="suche">
<
a id=hilfe class="oben" rel="nofollow" target="_blank" href=><script>document.write(Hilfe);</script></a>
<
a id=mail class="oben" rel="nofollow" href=><script>document.write(emailkontakt);</script></a>
<
script type="text/javascript">
document.getElementById('mail').href=Linkemailadresse;
document.getElementById('hilfe').href=Linkhilfe;
</
script>
</
div>
<
br>
</
div>
<
div class="grauekaesten">
<
div class="rotekaesten_unter">
<
div class="hauptmenue">
<
a href="h_index.html" id="startseite" title=><script>document.write(Startseite);</script></a>
<
script type="text/javascript">
document.getElementById('startseite').title=Startseite;
</
script>
<
a href="h_clock.html" id="einstellungen" title=><script>document.write(Einstellungen);</script></a>
<
script type="text/javascript">
document.getElementById('einstellungen').title=Einstellungen;
</
script>
<
a href="h_operatingdata.html" id="betriebsdaten" class="aktiv" title=><script>document.write(Betriebsdaten);</script><
<
script type="text/javascript">
document.getElementById('betriebsdaten').title=Betriebsdaten;
</
script>
<
a href="h_history.html" id="historie" title=><script>document.write(Historie);</script></a>
<
script type="text/javascript">
document.getElementById('historie').title=Historie;
</
script>
<
a href="h_service.html" id="service" title=><script>document.write(Service);</script></a>
<
script type="text/javascript">
document.getElementById('service').title=Service;
</
script>
<
a href="h_contact.html" id="AZKontakt" title=><script>document.write(Kontakt);</script></a>
<
script type="text/javascript">
document.getElementById('AZKontakt').title=Kontakt;
var 
anz '1';
if (
anz == 1)
document.getElementById('AZKontakt').value "";
else
document.getElementById('AZKontakt').style.display 'none';
</
script>
</
div>
<!-- 
hauptmenue -->
<
div class="zentral_unter" xstyle="border: 1px solid #FF0000; width: 950px">
<
div class="untermenue1">
</
div>
<!-- 
untermenue1 -->
<
div class="untermenue2">
<
div class="untermenue2innen">
<
ul class="eins">
</
ul>
</
div>
</
div>
<!-- 
untermenue2 -->
<
div class="inhalt">
<
div class="csc-textpic csc-textpic-intext-right csc-textpic-border">
<
div class="csc-textpic-imagewrap">
<
dl class="csc-textpic-image csc-textpic-firstcol csc-textpic-lastcol" style="width: 252px;">
  <
dd class="csc-textpic-caption"></dd>
</
dl>
</
div>
<
div class="csc-textpic-text">
<
h1>
<
script>document.writeln(Betriebsdaten);</script></h1>
</
div>
</
div>
<
div class="produkt">
<
div class="csc-frame csc-frame-invisible">
<
div class="csc-textpic csc-textpic-intext-left-nowrap">
<
div style="margin-left: 5px;">
<
div class="csc-textpic-text">
<
div class="div_terminologieliste">
<
table cellpadding="1" cellspacing="0" width="680">
 <
tbody>
  <
tr class="header">
   <
td bgcolor="#dddddd" width="50%">
    <
h3>
    <
script>document.write(Beschreibung);</script></h3>
   </
td>
   <
td align="right" bgcolor="#dddddd" width="30%">
    <
h3>
    <
script>document.writeln(AktuellerWert);</script></h3>
   </
td>
   <
td bgcolor="#dddddd" width="15%"></td>
   <
td bgcolor="#dddddd" width="5%"></td>
  </
tr>
<!-- 
Aussentemperatur -->
<
tr>
 <
td><script>document.write(Aussentemperatur);</script></td>
 <
td align='right'>5.3</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<!-- 
Ruecklaufsolltemperatur -->
<
tr id=z_men_sollfrei>
 <
td><script>document.writeln(Ruecklaufsolltemperatur);document.write(HkEins);</script></td>
 <
td align='right'>30.6</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
  if (
Val == 1)
   
document.getElementById('z_men_sollfrei').value "";
  else
   
document.getElementById('z_men_sollfrei').style.display 'none';
</
script>
<!-- 
Ruecklauftemperatur -->
<
tr>
 <
td><script>document.writeln(Ruecklauftemperatur);document.write(HkEins);</script></td>
 <
td align='right'>32.6</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<!-- 
Vorlauftemperatur -->
<
tr id=z_frei_tfs>
 <
td><script>document.write(Vorlauftemperatur);</script></td>
 <
td align='right'>38.5</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
  if (
Val == 1)
   
document.getElementById('z_frei_tfs').value "";
  else
   
document.getElementById('z_frei_tfs').style.display 'none';
</
script>
<!-- 
Solltemperatur 2.HK -->
<
tr id=z_hk2_anz_soll>
 <
td><script>document.writeln(Solltemperatur);document.write(HkZwei);</script></td>
 <
td align='right'>24.7</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('z_hk2_anz_soll').value "";
  else
   
document.getElementById('z_hk2_anz_soll').style.display 'none';
</
script>
<!-- 
Minimale Temperatur Gemischter Kreis -->
<
tr id=z_hk2_anz_min>
 <
td><script>document.write(MiniTempGK);</script></td>
 <
td align='right'>3.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('z_hk2_anz_min').value "";
  else
   
document.getElementById('z_hk2_anz_min').style.display 'none';
</
script>
<!-- 
Temperatur 2.HK -->
<
tr id=z_hk2_anz_ist>
 <
td><script>document.writeln(Temperatur);document.write(HkZwei);</script></td>
 <
td align='right'>24.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('z_hk2_anz_ist').value "";
  else
   
document.getElementById('z_hk2_anz_ist').style.display 'none';
</
script>
<!-- 
Solltemperatur 3.HK -->
<
tr id=p_hk3>
 <
td><script>document.writeln(Solltemperatur);document.write(HkDrei);</script></td>
 <
td align='right'>24.7</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('p_hk3').value "";
  else
   
document.getElementById('p_hk3').style.display 'none';
</
script>
<!-- 
Temperatur 3.HK -->
<
tr id=p_hk3_ist>
 <
td><script>document.writeln(Temperatur);document.write(HkDrei);</script></td>
 <
td align='right'>-999.9</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('p_hk3_ist').value "";
  else
   
document.getElementById('p_hk3_ist').style.display 'none';
</
script>
<!-- 
Heizung Anforderung -->
<
tr id=z_wpah_anz>
 <
td><script>document.write(HeizungAnforderung);</script></td>
 <
td align='right'><script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln(Nein);
                                 if (
Val == 1)
                                 
document.writeln(Ja);</script>
                        <
script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln();
                                 if (
Val == 1)
                                 
document.writeln(L11091);</script>
                        <
script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln();
                                 if (
Val == 1)
                                 
document.writeln(HeizungSpuelen);</script></td>
 <
td></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
  if (
Val == 1)
   
document.getElementById('z_wpah_anz').value "";
  else
   
document.getElementById('z_wpa_h').style.display 'none';
</
script>
<!-- 
Leistungsstufe -->
<
tr id=z_frei_hreg>
 <
td><script>document.write(Leistungsstufe);</script></td>
 <
td align='right'>
      <
script>var Val parseInt("1");
                  if (
Val == 0)
                  
document.writeln();
                  if (
Val == 1)
                  
document.write("1");</script>
      <
script>var Val parseInt("0");
                  if (
Val == 0)
                  
document.writeln();
                  if (
Val == 1)
                  
document.write("2");</script>
      <
script>var Val parseInt("0");
                  if (
Val == 0)
                  
document.writeln();
                  if (
Val == 1)
                  
document.write("3");</script></td>
 <
td></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
  if (
Val == 1)
   
document.getElementById('z_frei_hreg').value "";
  else
   
document.getElementById('z_frei_hreg').style.display 'none';
</
script>
<!-- 
Abtauendefühler -->
<
tr id=p_hg_abt>
 <
td><script>document.write(Abtauendefuehler);</script></td>
 <
td align="right">9.1</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('p_hg_abt').value "";
  else
   
document.getElementById('p_hg_abt').style.display 'none';
</
script>
<!-- 
Temperatur Speicher Regenerativ -->
<
tr id=z_biv_reg>
 <
td><script>document.write(TempSpeicherReg);</script></td>
 <
td align='right'>-999.9</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('z_biv_reg').value "";
  else
   
document.getElementById('z_biv_reg').style.display 'none';
</
script>
<!-- 
Rücklauftemperatur Kühlen passiv -->
<
tr id=z_frei_kreg>
 <
td><script>document.write(RLTempKp);</script></td>
 <
td align='right'>0.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
      
Val1 parseInt("0");
          
Val2 parseInt("0");
  if ((
Val == 1)&&(Val1 == 1)&&(Val2 == 1))
   
document.getElementById('z_frei_kreg').value "";
  else
   
document.getElementById('z_frei_kreg').style.display 'none';
</
script>
<!-- 
Vorlauftemperatur Kühlen passiv -->
<
tr id=z_frei_kreg1>
 <
td><script>document.write(VlTempKp);</script></td>
 <
td align='right'>0.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
      
Val1 parseInt("0");
          
Val2 parseInt("0");
  if ((
Val == 1)&&(Val1 == 1)&&(Val2 == 1))
   
document.getElementById('z_frei_kreg1').value "";
  else
   
document.getElementById('z_frei_kreg1').style.display 'none';
</
script>
<!-- 
Frostschutz Kälte Kühlen -->
<
tr id=p_wpk>
 <
td><script>document.write(FrostschutzKKl);</script></td>
 <
td align='right'>-999.9</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("0");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('p_wpk').value "";
  else
   
document.getElementById('p_wpk').style.display 'none';
</
script>
<!-- 
Raumtemperatur 1 -->
<
tr id=z_rt1_anz_frei>
 <
td><script>document.write(Raumtemperatur);</script></td>
 <
td align='right'>-999.9</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("0");
  if ((
Val == 1)|(Val1 == 1))
   
document.getElementById('z_rt1_anz_frei').value "";
  else
   
document.getElementById('z_rt1_anz_frei').style.display 'none';
</
script>
<!-- 
Raumfeuchte 1 -->
<
tr id=z_feuchte1>
 <
td><script>document.write(Raumfeuchte);</script></td>
 <
td align='right'>0.0</td>
 <
td><script>document.writeln(L02371);</script></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("1");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('z_feuchte1').value "";
  else
   
document.getElementById('z_feuchte1').style.display 'none';
</
script>
<!-- 
Raumtemperatur 2 -->
<
tr id=e_rt2>
 <
td><script>document.write(Raumtemperatur);</script>2</td>
 <
td align='right'>0.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("1");
      
Val2 parseInt("0");
  if ((
Val == 1)&&(Val1 == 1)&&(Val2 == 1))
   
document.getElementById('e_rt2').value "";
  else
   
document.getElementById('e_rt2').style.display 'none';
</
script>
<!-- 
Raumfeuchte 2 -->
<
tr id=z_feuchte2>
 <
td><script>document.write(Raumfeuchte);</script>2</td>
 <
td align='right'>0.0</td>
 <
td><script>document.writeln(L02371);</script></td>
<
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("1");
      
Val2 parseInt("0");
  if ((
Val == 1)&&(Val1 == 1)&&(Val2 == 1))
   
document.getElementById('z_feuchte2').value "";
  else
   
document.getElementById('z_feuchte2').style.display 'none';
</
script>
<!-- 
Anforderung Kühlung -->
<
tr id=z_kuehl_anf1>
 <
td><script>document.write(AnforderungKuehlung);</script></td>
 <
td align='right'><script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln(Nein);
                                 if (
Val == 1)
                                 
document.writeln(Ja)</script></td>
 <
td></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
      
Val1 parseInt("1");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('z_kuehl_anf1').value "";
  else
   
document.getElementById('z_kuehl_anf1').style.display 'none';
</
script>
<!-- 
Solltemperatur Warmwasser -->
<
tr id=z_ww_soll>
 <
td><script>document.writeln(Warmwasser);document.write(Solltemperatur);</script></td>
 <
td align='right'>43.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
      
Val1 parseInt("1");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('z_ww_soll').value "";
  else
   
document.getElementById('z_ww_soll').style.display 'none';
</
script>
<!-- 
Temperatur Warmwasser -->
<
tr id=e_wanf>
 <
td><script>document.writeln(Temperatur);document.write(Warmwasser);</script></td>
 <
td align='right'>37.7</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
      
Val1 parseInt("1");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('e_wanf').value "";
  else
   
document.getElementById('e_wanf').style.display 'none';
</
script>
<!-- 
Warmwasser Anforderung-->
<
tr id=z_wpa_w>
 <
td><script>document.write(WarmwasserAnforderung);</script></td>
 <
td align='right'><script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln(Nein);
                                 if (
Val == 1)
                                 
document.writeln(Ja);</script>
                         <
script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln();
                                 if (
Val == 1)
                                 
document.writeln(T_Reg>Temp.WW);</script></td>
 <
td></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
  if (
Val == 1)
   
document.getElementById('z_wpa_w').value "";
  else
   
document.getElementById('z_wpa_w').style.display 'none';
</
script>
<!-- 
Schwimmbad Anforderung -->
<
tr id=z_wpa_s1>
 <
td><script>document.write(SchwimmbadAnforderung);</script></td>
 <
td align='right'><script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln(Nein);
                                 if (
Val == 1)
                                 
document.writeln(Ja);</script>
                         <
script>var Val parseInt("0");
                                 if (
Val == 0)
                                 
document.writeln();
                                 if (
Val == 1)
                                 
document.writeln(1112);</script></td>
 <
td></td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("0");
  if (
Val == 1)
   
document.getElementById('z_wpa_s1').value "";
  else
   
document.getElementById('z_wpa_s1').style.display 'none';
</
script>
<!-- 
Eingefrierschutzfühler -->
<
tr id=e_egsf>
 <
td><script>document.write(Eingefrierschutzfuehler);</script></td>
 <
td align='right'>9.1</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
  var 
Val parseInt("1");
      
Val1 parseInt("1");
  if ((
Val == 1)&&(Val1 == 1))
   
document.getElementById('e_egsf').value "";
  else
   
document.getElementById('e_egsf').style.display 'none';
</
script>
<!-- 
Vorlauffühler Sole bei HK2-->
<
tr id=anz_s_trnl>
 <
td><script>document.writeln(Vorlauftemperatur);document.write(Sole);</script></td>
 <
td align='right'>24.0</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
   var 
Val 0;
       
Val1 parseInt("1");
       
Val2 parseInt("0");
   if ((
Val == 1)&&(Val1 == 1)&&(Val2 == 0))
     
document.getElementById('anz_s_trnl').value 'anz_s_trnl';
   else
     
document.getElementById('anz_s_trnl').style.display 'none';
</
script>
<!-- 
Vorlauffühler Sole bei HK3-->
<
tr id=anz_e_fsk>
 <
td><script>document.writeln(Vorlauftemperatur);document.write(Sole);</script></td>
 <
td align='right'>-999.9</td>
 <
td>°C</td>
 <
td></td>
</
tr>
<
script>
   var 
Val 0;
       
Val1 parseInt("1");
       
Val2 parseInt("0");
       
Val3 parseInt("0");
   if ((
Val == 2)&&(Val1 == 1)&&(Val2 == 0)&&(Val3 == 0))
     
document.getElementById('anz_e_fsk').value 'anz_e_fsk';
   else
     
document.getElementById('anz_e_fsk').style.display 'none';
</
script>
<!-- 
Codierung -->
<
tr>
 <
td><script>document.write(Codierung);</script></td>
 <
td align='right'><script>var codierung=0.3;
                           var 
codierung10=codierung*10;
                           if (
codierung10 == 0)
                           
document.writeln(T2530);
                           if (
codierung10 == 1)
                           
document.writeln(T2531);
                           if (
codierung10 == 2)
                           
document.writeln(T2532);
                           if (
codierung10 == 3)
                           
document.writeln(T2533);
                           if (
codierung10 == 4)
                           
document.writeln(T2534);
                           if (
codierung10 == 5)
                           
document.writeln(T2535);
                           if (
codierung10 == 6)
                           
document.writeln(T2536);
                           if (
codierung10 == 7)
                           
document.writeln(T2537);
                           if (
codierung10 == 8)
                           
document.writeln(T2538);
                           if (
codierung10 == 9)
                           
document.writeln(T2539);</script></td>
 <
td></td>
 <
td></td>
</
tr>
<!-- 
Software H -->
<
tr>
 <
td><strong><script>document.write(SoftwarestandHeizen);</script></strong></td>
 <
td><table width="100%" border="0">
   <
tr>
    <
td width="25%"><strong>BIOS</strong><br><script>var bios=41.0;
                                                     var 
bios10=bios/10;
                                                     
document.write(bios10);</script></td>
    <
td width="25%"><strong>BOOT</strong><br><script>var boot=40.3;
                                                     var 
boot10=boot/10+0.000000000000001;
                                                     
document.write(boot10);</script></td>
     <
td width="50%"><strong>SOFTWARE:</strong><br><script>var standh=0.1;
                                                         var 
standh10=standh*10;
                                                         if (
standh10 == 1)
                                                         
document.write("WPM_H");
                                                         if (
standh10 == 2)
                                                         
document.write("WPM_K");
                                                         if (
standh10 == 3)
                                                         
document.write("WPM_KP");
                                                         var 
stand1h=0.8;
                                                         var 
stand1h10=stand1h*10;
                                                         if (
stand1h10 == 1)
                                                         
document.write("_A");
                                                         if (
stand1h10 == 2)
                                                         
document.write("_B");
                                                         if (
stand1h10 == 3)
                                                         
document.write("_C");
                                                         if (
stand1h10 == 4)
                                                         
document.write("_D");
                                                         if (
stand1h10 == 5)
                                                         
document.write("_E");
                                                         if (
stand1h10 == 6)
                                                         
document.write("_F");
                                                         if (
stand1h10 == 7)
                                                         
document.write("_G");
                                                         if (
stand1h10 == 8)
                                                         
document.write("_H");
                                                         if (
stand1h10 == 9)
                                                         
document.write("_I");
                                                         if (
stand1h10 == 10)
                                                         
document.write("_J");
                                                         if (
stand1h10 == 11)
                                                         
document.write("_K");
                                                         if (
stand1h10 == 12)
                                                         
document.write("_L");
                                                         if (
stand1h10 == 13)
                                                         
document.write("_M");
                                                         if (
stand1h10 == 14)
                                                         
document.write("_N");
                                                         if (
stand1h10 == 15)
                                                         
document.write("_O");
                                                         if (
stand1h10 == 16)
                                                         
document.write("_P");
                                                         if (
stand1h10 == 17)
                                                         
document.write("_Q");
                                                         if (
stand1h10 == 18)
                                                         
document.write("_R");
                                                         if (
stand1h10 == 19)
                                                         
document.write("_S");
                                                         if (
stand1h10 == 20)
                                                         
document.write("_T");
                                                         if (
stand1h10 == 21)
                                                         
document.write("_U");
                                                         if (
stand1h10 == 22)
                                                         
document.write("_V");
                                                         if (
stand1h10 == 23)
                                                         
document.write("_W");
                                                         if (
stand1h10 == 24)
                                                         
document.write("_X");
                                                         if (
stand1h10 == 25)
                                                         
document.write("_Y");
                                                         if (
stand1h10 == 26)
                                                         
document.write("_Z");
                                                         var 
version=5.5;
                                                         var 
version10=version*10;
                                                         
document.write(version10);</script></td>
  </
tr>
 </
table></td>
</
tr>
<!-- 
Software K -->
<
tr id=BIOS_RELEASE>
 <
td><strong><script>document.write(SoftwarestandKuehlen);</script>:</strong></td>
 <
td><table width="99%" border="0">
  <
tr>
   <
td width="25%"><strong>BIOS</strong></td>
   <
td width="25%"><strong>BOOT</strong></td>
   <
td width="45%"><strong>SOFTWARE:<script>var z_sw_gruppe_ka=0.0;
                                                 var 
z_sw_gruppe_ka10=z_sw_gruppe_ka*10;
                                                 if (
z_sw_gruppe_ka10 == 1)
                                                 
document.write("WPM_H");
                                                 if (
z_sw_gruppe_ka10 == 2)
                                                 
document.write("WPM_K");
                                                 if (
z_sw_gruppe_ka10 == 3)
                                                 
document.write("WPM_KP");</script>
                                         <
script>var z_sw_version=0.0;
                                                 var 
z_sw_version10=z_sw_version*10;
                                                 if (
z_sw_version10 == 1)
                                                 
document.write("_A");
                                                 if (
z_sw_version10 == 2)
                                                 
document.write("_B");
                                                 if (
z_sw_version10 == 3)
                                                 
document.write("_C");
                                                 if (
z_sw_version10 == 4)
                                                 
document.write("_D");
                                                 if (
z_sw_version10 == 5)
                                                 
document.write("_E");
                                                 if (
z_sw_version10 == 6)
                                                 
document.write("_F");
                                                 if (
z_sw_version10 == 7)
                                                 
document.write("_G");
                                                 if (
z_sw_version10 == 8)
                                                 
document.write("_H");
                                                 if (
z_sw_version10 == 9)
                                                 
document.write("_I");
                                                 if (
z_sw_version10 == 10)
                                                 
document.write("_J");
                                                 if (
z_sw_version10 == 11)
                                                 
document.write("_K");
                                                 if (
z_sw_version10 == 12)
                                                 
document.write("_L");
                                                 if (
z_sw_version10 == 13)
                                                 
document.write("_M");
                                                 if (
z_sw_version10 == 14)
                                                 
document.write("_N");
                                                 if (
z_sw_version10 == 15)
                                                 
document.write("_O");
                                                 if (
z_sw_version10 == 16)
                                                 
document.write("_P");
                                                 if (
z_sw_version10 == 17)
                                                 
document.write("_Q");
                                                 if (
z_sw_version10 == 18)
                                                 
document.write("_R");
                                                 if (
z_sw_version10 == 19)
                                                 
document.write("_S");
                                                 if (
z_sw_version10 == 20)
                                                 
document.write("_T");
                                                 if (
z_sw_version10 == 21)
                                                 
document.write("_U");
                                                 if (
z_sw_version10 == 22)
                                                 
document.write("_V");
                                                 if (
z_sw_version10 == 23)
                                                 
document.write("_W");
                                                 if (
z_sw_version10 == 24)
                                                 
document.write("_X");
                                                 if (
z_sw_version10 == 25)
                                                 
document.write("_Y");
                                                 if (
z_sw_version10 == 26)
                                                 
document.write("_Z");
                                                 else
                                                 
document.write("");</script>
                                         <
script>var z_sw_nummer_ka=0.0;
                                                 var 
z_sw_nummer_ka10=z_sw_nummer_ka*10;
                                                 
document.write(z_sw_nummer_ka10);</script></strong></td>
        </
tr>
      </
table></td>
  </
tr>
<
script>
  var 
Val parseInt("");
  if (
Val == 1)
   
document.getElementById('BIOS_RELEASE').value "";
  else
   
document.getElementById('BIOS_RELEASE').style.display 'none';
</
script>
</
tbody>
</
table>
</
div>
</
div>
</
div>
</
div>
</
div>
</
div>
</
div>
<!-- 
inhalt -->
<
div class="fusszeile">
<
div style="float: left;"><a href="javascript:print();"><img src="../index_img/drucken.gif" id="seitedrucken" border="0
<script>document.writeln(Drucken);</script></a>
<script type="
text/javascript">
document.getElementById('seitedrucken').title=seitedrucken;
</script>
</div>
<div style="
floatright;"><a href="#oben"><img src="../index_img/pfeilnachoben.gif" alt="Nach Oben" border="0" height=
</div>
</
div>
</
div>
</
div>
</
div>
</
body>
</
html>

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@Raziel

[quote]The reason why i break the loop without reading the file to the end is because on line 691 i ALWAYS get a requester telling me i have to assign or mount this to go on
Quote:



<td><strong><script>document.write(SoftwarestandKuehlen);</script>:</strong></td>




I don't understand why the OS should jump in with this line?

I checked the source file and this is the ONLY place where a ":" exists between two "><".
But if the OS tries to mount such, it is clearly a bug (Workbench or AREXX)[/qquote]

something is possibly pickingg up >: as a redirect to an impossible file.

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@Raziel
I your copied your AREXX script & HTML file; then stripped all the $A0 characters and tested your script with the HTML file. Sometimes error messages (especially in AREXX) do not indicate the true cause of the error. My tests indicate that in a subsequent run of the script there is no input file present or it's not readable. When I added a test for successful opening of the file and exiting if the opening failed, I didn't get the "READLN(WP_read)" failure.

Try replacing the line:

OPEN(WP_read,'T:WP_Data.html','R')

with the lines:

IF ~OPEN(WP_read,'T:WP_Data.html','R') THEN DO
SAY "File opening failed"
LEAVE
END

I'll take a look at your other problem tommorrow.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
There is a difference between

ReadLn(Something)

and

Call ReadLn(Something)

The former will try to run the result as a command to whatever port AREXX is currently addressing.

The latter will just read a line, store it nowhere and not try to run it as a command or send it off as a command to an arexx port.

I don't know why it's working on the first run and not subsequent ones, but I suspect it can be solved by adding "Call" before ReadLn's that don't get stored into any variable.

For example, you can create a file, say RAM:test, with the word "time" in it. Then you can create a script:

/**/

ADDRESS COMMAND

Call Open(File,"RAM:test","R")
ReadLn(File)
Call Close(File)
Exit

and that will open the time preferences program. If you modify RAM:test to say "hello:hello2" instead of "time", it will ask you to insert hello:, and for some reason it'll still do that even if you remove "ADDRESS COMMAND" from the script.


Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@MickJT
Your suggestion seems to be the solution to both of Raziel's problems. When I tested his script with his HTML example, replacing the bare "READLN(WP_read)" lines with "CALL READLN(WP_read)" seems to work. However, I still think he should check for a valid file opening even if it's an unlikely occurance.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@xenic

I agree. It's always worth the effort to add error handling to anything you're programming, also in ARexx. When things behave strangely, it will often show you that some assumption you made is not true, like in this case where you simply can't open the file the second time.

I'd also always code READLN as a true function call, complete with assignment of the return value, like "dummy = readln(myFile)". Even if the result is not ultimately needed, it makes it very easy to add a "say dummy" line after it whenever you're in doubt about what, if anything, it is actually reading.

@Raziel:

Did you get that ARexxGuide I recommended above? It has lots of good examples in addition to the formal definitions and descriptions of all the ARexx elements.

BTW, it also tells you how to single-step debug your code. Look up TCO in the COMMANDS section, and move on to the tutorial Debugging a script. There are several options described. What I usually prefer for not overly long scripts is to simply open the tracing console (TCO), then start tracing globally (TS), and then just start my script. The console will then single-step through the code, letting me know almost everything that happens in each line. Only for special needs or very long loops etc. do I need to actually put trace statements in the code. When I'm done, I just enter TE and TCC in the shell.

Doing this with your script would probably have given you lots of clues quickly about what was going on.

Best regards,

Niels

Go to top
Re: Help with Arexx Script
Home away from home
Home away from home


See User information
Thanks for all the answers, I'm not on my amiga right now, but will take all the hints to heart.

@nbache

Yes, but I haven't got time to read it yet.

I'm "normally" use all commands like your "dummy" example, just not this time, perfect timing

I'm already using TS and a normal shell for debugging, works great, one reason why I like scripting with arexx, it's nice and easy to find and fix mistakes.
Perfect for auto didacts.

@MickJt

Wow, I didn't know about this "feature", I guess I also never read about it.
I find it rather dangerous imo.

@xenic

I'll put your failure check in once I'm home.
You are right, panic switches should also be built in.
I think I'll put it into a loop to retry downloading and opening after some time if it fails.

Go to top
Re: Help with Arexx Script
Just can't stay away
Just can't stay away


See User information
@Raziel

FYI, it's not limited to ReadLn. It's the way REXX works (not just AREXX). Here is another example:

/**/

ADDRESS COMMAND /* Sets outgoing AREXX port to COMMAND */

'ECHO "test 1 2 3"' /* Sent to the COMMAND port */

Command='ECHO "test 4 5 6"'
Command /* Alternative method */

ProgList="date requestfile shownetstatus"

DO i=1 TO 3
SubWord
(ProgList,i,1/* Sends result to the COMMAND port */
End

Exit


Think about what you'd expect if you used:

ADDRESS COMMAND ReadLn(File)

Assuming no AREXX port had been manually set yet, that will temporarily switch to the COMMAND port, run the result, and switch back to the REXX port. In the script example above, COMMAND was already set as the AREXX port ahead of time.

When you use ReadLn() without anything proceeding it, by default it sends the result to the REXX port. That's what was happening in your script.

I remember when writing something for Regina REXX, I couldn't use "Call Function()" when I didn't need to store the result, so I just used "Null=Function()" instead, because Function() on its own would cause havoc.

Wrap your head around this one!

/**/
Word="'hello'"
Temp='"SAY 'Word'"'
Temp /* Prints hello */
Exit


The Word variable is set to 'hello' (single quotes included)

Temp is set to "SAY 'hello'" (both types of quotes included)

Then the contents of Temp is sent to the REXX port. Those contents direct it to say the word hello.

Edit: Removed stuff that may have caused confusion.


Edited by MickJT on 2018/10/4 1:57:24
Edited by MickJT on 2018/10/4 2:01:42
Edited by MickJT on 2018/10/4 2:02:32
Edited by MickJT on 2018/10/4 2:06:34
Edited by MickJT on 2018/10/4 2:10:39
Go to top
Re: Help with Arexx Script
Home away from home
Home away from home


See User information
Thank you for the info mick

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project