[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Toon onderwerp - 2 variabelen bij elkaar optellen • nodo-domotica.nl

nodo-domotica.nl

2 variabelen bij elkaar optellen

Met de Nodo commando's en dee Eventlist kun je vrijwel elke domotica wens realiseren. De Nodo beschikt hiervoor over een eigen script-taal waarmee u uw domotica wensen kunt realiseren. Plaats hier uw vragen en tips die hier op betrekking hebben.

2 variabelen bij elkaar optellen

Berichtdoor Anton » 04 feb 2015, 22:24

Voor mijn energie meter zou ik graag 2 variabelen bij elkaar willen optellen, zodat ik het dagverbruik op een lcd scherm kan zetten.

Omdat hiervoor geen commando is wil ik proberen hiervoor een plugin te maken.
Mijn idee is om het volgende commando te maken:
calc <var1>, <var2>
Hierbij wordt dan de inhoud van var 2 opgeteld bij var 1 , en in var 1 geplaatst
De uitleg bij plugin_255 begrijp ik niet helemaal, maar het is me wel gelukt om iets op te tellen.

case PLUGIN_COMMAND:
{
UserVar[event->Par1 -1] = 15 + 30 ;
success=true;
break;


calc 12,13 vult nu var12 met het getal 45.

Hoe kan ik nu de inhoud van 2 variabelen bij elkaar optellen?

UserVar[event->Par1 -1] = float(UserVar[event->Par1 -1] + UserVar[event->Par1];

Bovenstaand levert niet het juiste resultaat.

Wie kan mij een beetje op weg helpen?
En zijn er nog meer zaken waar ik op moet letten.

Alvast bedankt!
Anton
 
Berichten: 28
Geregistreerd: 01 jan 2014, 18:43

Re: 2 variabelen bij elkaar optellen

Berichtdoor rtenklooster » 01 maart 2015, 16:14

Laatst bijgewerkt door rtenklooster op 01 maart 2015, 16:22, in totaal 1 keer bewerkt.
rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: 2 variabelen bij elkaar optellen

Berichtdoor rtenklooster » 01 maart 2015, 16:19

rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: 2 variabelen bij elkaar optellen

Berichtdoor Anton » 01 maart 2015, 21:39

Anton
 
Berichten: 28
Geregistreerd: 01 jan 2014, 18:43

Re: 2 variabelen bij elkaar optellen

Berichtdoor Anton » 01 maart 2015, 21:56

Anton
 
Berichten: 28
Geregistreerd: 01 jan 2014, 18:43

Re: 2 variabelen bij elkaar optellen

Berichtdoor rtenklooster » 01 maart 2015, 22:36

Mooi dat het gelukt is. Waarom het #%%# gebeuren niet werkt weet ik niet. Ik wist niet van het bestaan af, tot ik het tegenkwam vanmiddag.
rtenklooster
 
Berichten: 377
Geregistreerd: 04 aug 2012, 12:10
Woonplaats: Aduard

Re: 2 variabelen bij elkaar optellen

Berichtdoor Paul » 05 maart 2015, 22:18

Groeten Paul
Paul
 
Berichten: 1152
Geregistreerd: 31 aug 2011, 20:33

Re: 2 variabelen bij elkaar optellen

Berichtdoor Anton » 05 maart 2015, 23:41

Anton
 
Berichten: 28
Geregistreerd: 01 jan 2014, 18:43

Re: 2 variabelen bij elkaar optellen

Berichtdoor manjh » 06 maart 2015, 10:15

Volgens mij werken die instructies alleen in een script, en daarom dus alleen op een mega met sd card...
Hans
manjh
 
Berichten: 1173
Geregistreerd: 29 aug 2011, 14:39

Re: 2 variabelen bij elkaar optellen

Berichtdoor Anton » 06 maart 2015, 10:44

Anton
 
Berichten: 28
Geregistreerd: 01 jan 2014, 18:43

Volgende

Keer terug naar Nodo scripts

Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers. en 3 gasten