Dart Code Examples/en: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Cg (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „Create a new Dart action, and add an output pin named "out1". Uncomment the pin-output write line. import 'dart:io'; import 'expecco'; main() { Str…“) |
Cg (Diskussion | Beiträge) |
||
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
=== Pin Access, Generating Logs === |
|||
Create a new Dart action, and add an output pin named "out1". |
Create a new Dart action, and add an output pin named "out1". |
||
Uncomment the pin-output write line. |
Uncomment the pin-output write line. |
||
Zeile 15: | Zeile 17: | ||
logInfo(inVal); |
logInfo(inVal); |
||
} |
} |
||
Notice the import of the 'expecco' pseudo package, which defines a number of functions (logInfo, logWarning, etc. as described in [[ElementaryBlock_Element/en#Predefined_Functions|Predefined_Functions]]). |
|||
<br>The input pin's value is read with "<code>$(in1)</code>". |
|||
<br>The output is written with "<code>out('out1', ...);</code>" |
Aktuelle Version vom 9. Oktober 2024, 07:49 Uhr
Pin Access, Generating Logs[Bearbeiten]
Create a new Dart action, and add an output pin named "out1". Uncomment the pin-output write line.
import 'dart:io'; import 'expecco'; main() { String message = 'Hello again'; String inVal = '$(in1)'; print('Hello World from Dart'); stderr.writeln(':logInfo:${message}'); logInfo('another info'); out('out1', 'a value at a pin'); logInfo(inVal); }
Notice the import of the 'expecco' pseudo package, which defines a number of functions (logInfo, logWarning, etc. as described in Predefined_Functions).
The input pin's value is read with "$(in1)
".
The output is written with "out('out1', ...);
"