News:

  • September 23, 2026, 01:29:40 PM

Login with username, password and session length

Author Topic: String Print  (Read 6709 times)

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
String Print
« on: February 19, 2022, 09:42:02 AM »
I,m using multiple Print to string to write an alarm email message. Is it possible to have each new string added to email, to start a new line within the message. So instead of  SL1 SL2 SL3 SL4, I need
SL1
SL2
SL3
SL4

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: String Print
« Reply #1 on: February 19, 2022, 03:51:43 PM »
I,m using multiple Print to string to write an alarm email message. Is it possible to have each new string added to email, to start a new line within the message. So instead of  SL1 SL2 SL3 SL4, I need
SL1
SL2
SL3
SL4
In the STRPRINT or the EMAIL instructions, you can use "$N" after the end of each string which translates to carriage return, line feed ("$0D$0A"). In the Print Script of those instructions it would look like:

SL1 "$N" SL2 "$N" SL3 "$N" SL4
There are two types of people in the world; those that can extrapolate from incomplete data sets.

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: String Print
« Reply #2 on: February 19, 2022, 11:50:59 PM »
Awesome, thanks.