Internet PLC Forum

General => Technical support => Topic started by: cdenk on October 08, 2007, 01:52:26 PM

Title: cust fun line continuation
Post by: cdenk on October 08, 2007, 01:52:26 PM
Is there a way to continue a long line in a custom function, or print it, where the end isn't printed, or wrapped to next line?
Title: Re:cust fun line continuation
Post by: support on October 08, 2007, 04:24:36 PM
can you cite an example of a long line? Most statements are short and if you have multiple conditions you can just split them up into two  or more  lines:

E.g.
IF TESTIO(LABEL1) AND TESTIO(LABEL2)
              AND TESTIO(LABEL3)
              AND TESTIO(LABEL4)
   A = 1
ELSE
   A = 2
ENDIF


The effect is the same as:

IF TESTIO(LABEL1) AND TESTIO(LABEL2)  AND TESTIO(LABEL3) AND TESTIO(LABEL4)
    A = 1
ELSE
   A = 2
ENDIF
Title: Re:cust fun line continuation
Post by: cdenk on October 08, 2007, 06:11:18 PM
Here's the statement, I think your answer solved my problem, I'll just add a new line and tab before an AND where needed to break up the line. Thanks for the quick reply. :)


IF (DATE[3] > (7 * (DM[3975] - 1 )) AND (DATE[3] < (7 * DM[3975]) + 1) AND (DATE[4] = DM[3976]) AND (TIME[1] = DM[3977]) AND (TIME[2] = 0) AND (TIME[3] >= 0))

And here's the new:

IF (DATE[3] > (7 * (DM[3975] - 1 ))
     AND (DATE[3] < (7 * DM[3975]) + 1)
     AND (DATE[4] = DM[3976])
     AND (TIME[1] = DM[3977]) AND (TIME[2] = 0)
     AND (TIME[3] >= 0))