Notifications
Announcements
No record found.
I remember seeing a single macro to assign null value for all datatypes. Can you anyone give me that macro name?
*This post is locked for comments
Such a thing doesn't make sense. If you want to assign null to reference types, simply do it; you don't need anything special.
But you can't do it with "all datatypes", because null isn't a valid value for primitive data types. For instance, you can't assign null to int; there you can only use its default value (0). If this is what you mean, use nullValue(), nullValueBaseType() or nullValueFromType().
int num = 10;
real r = 1.1;
str s = "my name is vinodh";
//assigning null standard way
num = 0;
s = "";
//instead, what im asking, any silver bullet macro to assign null for all //variables
num = [tag:Macro];
s = [tag:Macro];
Neither 0 and "" is null. These are default primitive values (not null) for given primitive data types.
I already gave you the solution for your actual requirement (assigning the default value for any type).
You're wrong in thinking that a macro would do the job (unless the macro actual contains code like what I mentioned). Stop wasting time looking for macro that doesn't exist and use the methods that do exist.
Thanks Martin.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2