Nasal library/debug: Difference between revisions

Jump to navigation Jump to search
→‎Functions: Doc propify()
(Doc printerror())
(→‎Functions: Doc propify())
Line 238: Line 238:


=== propify() ===
=== propify() ===
{{Nasal doc
|syntax = debug.propify(p[, create]);
|text = Attempts to turn its argument into a {{func link|Node|props}} object and return it. If it can't, it will return <code>'''nil</code>.
|param1 = p
|param1text = Thing to turn into a node. May be a <code>props.Node</code> object, a <code>prop</code> ghost, or a string pointing to a property.
|param2 = create
|param2text = If the above argument is a string, this specifies whether to create the property. Defaults to 0 (false).
|example1 = var p = canvas._newCanvasGhost()._node_ghost;
debug.dump(debug.propify(p));
|example2 = var p = "/sim/time/gmt";
debug.dump(debug.propify(p));
|example3 = var p = "/demo";
debug.dump(debug.propify(p, 1));
|example4 = var p = func(){ print("Hello, World!"); }
debug.dump(debug.propify(p)); # prints "nil"
}}
=== proptrace() ===
=== proptrace() ===
=== rank() ===
=== rank() ===

Navigation menu