Would you consider changing the hidden attribute to allow an expression instead of just true or false?
This would make it possible for template code to decide on the fly whether or not to hide something in the Template Results window.
Would you consider changing the hidden attribute to allow an expression instead of just true or false?
This would make it possible for template code to decide on the fly whether or not to hide something in the Template Results window.
Hello GLT. Yes, we’ve had a few requests for this and it is coming. Cheers!
Graeme
SweetScape Software
Is there an alternative way to do it at the moment? Maybe using macros or something
I don’t believe there is any way for the hidden status to be set with a function right now. One option is to set up some #define’s at the beginning of the file and then use those to control the hidden status. For example you could use:
#define HIDESTATUS false
int var1 <hidden=HIDESTATUS>;
int var2 <hidden=HIDESTATUS>;
Then just change HIDESTATUS to true to hide those variables. Another option would be to just use a conditional when creating the variable:
if( test > 5 )
int myvar <hidden=true>;
else
int myvar <hidden=false>;
Graeme
SweetScape Software
<hidden> can now be an expression or function starting in 010 Editor v16. You can try out the beta here: 010 Editor - Beta Release
Graeme
SweetScape Software
Hi, I have the latest version, and I’m trying to use the hidden=[function] feature.
The docs tell me it is possible, but do not tell me the signature for the function.
I have tried:
bool hideRecord(record& r) – syntax error
string hideRecord(record& r) – argument 1 was an incompatible type.
string hideRecord(record r) – struct or union argument 1 must be passed by reference.
Please let me know the correct signature, and please also update the docs!
Many thanks - love the product!
Rob
Ok - figured it out myself.
The signature is: int name(type& t).
The reason I was getting “the argument 1 was an incompatible type” was because I was missing the <optimize=false> attribute. Adding that made everything work as expected.
We will add some more information to the documentation to make this more clear. The hidden function has to return true or false and you can use any integer type. You can use ‘bool’ but since the size of ‘bool’ is ambiguous we require that users define their own bool type. For example:
typedef int bool;
struct record { int id; } r <hidden=HiddenFunc>;
bool HiddenFunc( record &rec )
{
return rec.id < 0;
}
Graeme
SweetScape Software