Arcadian
Arcadian

Reputation: 4350

Setting %nullind rpg using one line

Is there a way in RPG to assign a boolean value in one line without a if statement?

for example in C# you can do:

bool x = (some condition = true);

is there a way to do something like this in rpg:

 %nullind(FIELD) = (FIELD=="");

Is this the right way (only way):

 *in01 = (Somevalue=AnotherValue);
  %nullind(field) = *in01;

Also,

when I initially turn ON the nullind do I have to turn it off in order to get the field to update to a non-null value?

Upvotes: 2

Views: 673

Answers (1)

David G
David G

Reputation: 4014

Yes, make the assignment to an indicator type variable (type N).

*in01 = (somevalue = anothervalue);

Upvotes: 4

Related Questions