79239597

Date: 2024-11-30 13:10:59
Score: 1.5
Natty:
Report link

I found that I needed to simplify how I copied from the const TValue to a local variable so I could access the contents without getting the error regards Value being const but function not.

This code did not make MyValue = Value, it changed it to a "tkRecord" type.

TValue MyValue;
#ifndef __clang__
  MyValue = TValue::_op_Implicit(Value);
#else
  MyValue = TValue::From(Value);
#endif
bool myVal = MyValue.AsBoolean();

All I actually needed to do was simply copy the value into my own variable. Then I could access the Kind and determine what type the TValue is.

TValue MyValue = Value;
System::Typinfo::TTypeKind Kind = MyValue.Kind;

In my case I found Kind was "tkString", once I knew this, I was able to do a string compare to determine the boolean value "True" and "False".

Reasons:
  • Blacklisted phrase (1): regards
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Barry Andrews