LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Scan From String" - something I didn't know...


@DavidBoyd wrote:

The other comment I really wanted to make:  as a long-ago C programmer, I've always used LV's Scan From String and Format Into String nodes for their versatility and coherence with C stdlib's sscanf() and printf() and their ilk.  That entire subpalette of Number/String Conversion one-off nodes is a no-go zone for me (20+ years of LV programming). Give me error terminals, offset past match, and growable inputs/outputs!


I actually find myself using the Number/String Conversion palette more and more over the years.  This is pretty exclusive to when I only have 1 value.  But I would say that I abuse the Scan From String and Format Into String nodes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 21 of 25
(814 Views)

@DavidBoyd wrote:

That entire subpalette of Number/String Conversion one-off nodes is a no-go zone for me (20+ years of LV programming). Give me error terminals, offset past match, and growable inputs/outputs!


They have one big advantage: the work on arrays. 

Message 22 of 25
(793 Views)

wiebe@CARYA wrote:


They have one big advantage: the work on arrays. 


Subtle correction:  "... most work on arrays" 😄

0 Kudos
Message 23 of 25
(779 Views)

I totally missed the fact these nodes are polymorphic - for clusters, too! - and in both conversion directions.  Thanks, Wiebe!

 

Interestingly, the default value input (to be returned for a scan failure) doesn't adapt to the datatype, so you only get one common default.  But I suppose these nodes are really intended for bulk conversion of like elements anyway, so that's hardly a limitation.

 

I'll have to keep these nodes in mind next time I encounter a situation where bulk conversion is needed.

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 24 of 25
(769 Views)

@DavidBoyd wrote:

I'll have to keep these nodes in mind next time I encounter a situation where bulk conversion is needed.


My most frequent use case is to display 2D numeric arrays in a table. One step! 😄

Message 25 of 25
(765 Views)