2

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?

Buck Calabro
  • 7,558
  • 22
  • 25
Arcadian
  • 4,312
  • 12
  • 64
  • 107

1 Answers1

4

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

*in01 = (somevalue = anothervalue);
David G
  • 3,940
  • 1
  • 22
  • 30
  • so that would still be more than two lines which is ok.. would it be something like: *inO1 = (SOMEVALUE=AnotherValue); %nullind(field) = %in01; – Arcadian May 29 '13 at 17:43
  • 4
    Have you tried doing: `%nullind(field) = (somevalue = anothervalue);` ? – David G May 29 '13 at 17:46