Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Using Auto Justify Assignments

I recently ran into a client who did concatenation like this


I like to use the auto justify feature but found that the colon would disappear if I clicked next to the equal sign on the line I highlighted. I suspect the original code was done with a different editor as when I try to recreate this using the SRP Editor I cannot place the colon as shown in the image. I did not notice that the colon was going away until I introduced an error.

I am using editor version 3.4.5.0

Comments

  • Should there be a space between "ADDRLINE" and the colon and no space between the colon and the = sign.
  • Yeah, the formatter probably sees ADDRLINE: as a label.
  • But it's also worth noting that the auto-justifier only works for multiple lines that are setting the same variable.
  • The problem I ran into was one in which there were multiple lines and the colon was removed. So the data that was supposed to be appended was over writing. The problem I think stems from the misuse of the concatenation. At least I never learned it to be typed like this Variable1: = Variable2.

    Kevin there was also the same behavior with TotalVariable1+ = Variable1

    That might provide a clue. Is the operator being treated differently from an alpha character as you readjust the spacing?

    One other thing I noted was that if I position the cursor in front of the equal sign and type in a plus or colon then the misplaced one disappears and the corrected one is in the right position and the alignment works as I would expect.
  • I can assure you that the justify array feature is not doing parsing that sophisticated. It's looking for tokens like ':=' and '+='. If I can be a little cheeky, that syntax is silly, if not outright evil.
  • edited November 5
  • Yup, as I said I had never seen it done that way before. In fact using the SRP editor I could not place a colon or plus sign next to the first variable then a space followed by the second variable. This was old code that was probably created with the RTI editor or maybe even an old AREV one.

    I posted this to help others avoid the error I made. I make enough of my own, on my own. :-)
  • In fact using the SRP editor I could not place a colon or plus sign next to the first variable then a space followed by the second variable.

    I see what you are experiencing. I agree with you, this code was obviously written with a native editor. I think I would consider this a bug with the SRP Editor, albeit a minor one.
Sign In or Register to comment.