Assignment operator in Pl1



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

Assignment operator in Pl1

Postby Fayisck » Mon Apr 21, 2014 12:18 pm

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
Fayisck
 
Posts: 2
Joined: Fri Dec 17, 2010 11:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Assignment operator in Pl1

Postby enrico-sorichetti » Mon Apr 21, 2014 12:53 pm

PL/1 is space and case agnostic.
( spacing and casing will be honored for DATA - inside strings, for example )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Assignment operator in Pl1

Postby Fayisck » Mon Apr 21, 2014 12:59 pm

Thanks Enrico for your reply.
So do you say I should leave a space in above case?
Fayisck
 
Posts: 2
Joined: Fri Dec 17, 2010 11:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Assignment operator in Pl1

Postby enrico-sorichetti » Mon Apr 21, 2014 1:06 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post