Page 1 of 1

Assignment operator in Pl1

PostPosted: Mon Apr 21, 2014 12:18 pm
by Fayisck
Hello All,

I have a question.
Do we need to leave a space while assigning a value to a variable or compare a variable with any value? If I have not left a space will it create confusion for the compiler?
For example IF i code as below

IF A^=' '
will the compiler take statement same as
IF A ^= ' ' ? (If A is not equal to blank? )

I have faced a scenario where the compiler some times do understand IF statement if coded it with a leaving a space.
Please help

Re: Assignment operator in Pl1

PostPosted: Mon Apr 21, 2014 12:53 pm
by enrico-sorichetti
PL/1 is space and case agnostic.
( spacing and casing will be honored for DATA - inside strings, for example )

Re: Assignment operator in Pl1

PostPosted: Mon Apr 21, 2014 12:59 pm
by Fayisck
Thanks Enrico for your reply.
So do you say I should leave a space in above case?

Re: Assignment operator in Pl1

PostPosted: Mon Apr 21, 2014 1:06 pm
by enrico-sorichetti
So do you say I should leave a space in above case?


PL/1 does not care ...

I do not care ;) ...

but somebody in Your organization quality assurance
and people trying to read and understand Your program might...

most organization have a chapter of their programming standards
describing the formatting rules of programs
( comments, spacing, indenting, ... )

proper spacing makes the program more readable anyway