The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Type Cast & String To Byte Array

SercoSteveB
Active Participant

What is the value of Boolean Out following execution of the VI?

Type Cast.png

a) TRUE

b) FALSE

Comments
LordNobady
Member

A


Learning LabVIEW since January 2013
crossrulz
Knight of NI

A


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
gmarz5
Member

A

Michalph
Member

A

MrStevenUND
Member

A

lvrat
Active Participant

A

*************************************************
CLD
*************************************************
SwamyM
Member

Ans : A

g_l_u_p
Member

I'll go with A too

mini09
Active Participant

Answer is A. If I`ve some values in the U8 Array there is no change in the result?

LordNobady
Member

no it is just the type to cast to. thy typecast only tells the compiler that from that moment on the value is to be seen as the given type. if the type is not compatible I don't know what it will do. In C it can crash.

WARNING it converts it at byte level not value level. so casting an int to a double will not give you the same value.

Typecasts are some of the most powerful programmers tools. ( and with grate power comes grate responsibility ) use with care.


Learning LabVIEW since January 2013
JasonDiv
Member

Can anyone explain to me this concept please?

crossrulz
Knight of NI

Which concept?  The Type Cast?  The Type Cast just changes how the raw binary data is interpreted.  In this case, the data in the string is being reinterpreted as a byte array (U8).  This is the same thing as using the String To Byte Array function.


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
JasonDiv
Member

So the equal? is actually comparing data types instead of the actual values?

crossrulz
Knight of NI

No.  The Equal is comparing the data in the arrays.  It was set to compare Aggregates, which returns a single boolean for if the entire arrays were the same.  You can also setup the equal to compare Elements, which will return an array of booleans indicating if the corresponding elements were the same.


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
JasonDiv
Member

Thanks crossrulz.. Am now a follower of the The Daily CLAD

erganesh
Member

Condition is true