How Do I Format an Expression in the Expression Window? (Magic xpi 3.x)
Some expressions can be very long and complex. For instance, suppose you have a nested IF statement:
IF (Source/S3/Record/CustomerExists, '', '<a href= "http://localhost/magicxpi4/MGrqispi.dll?appname=IFSmagic xpi_course&prgname=HTTP&arguments=- ARequestConfirmation%23add_customer&RequestNum=' & Trim (Str( F.HTTP_Request_Num,'5')) & ' "> ' & Trim ( Str (Source/S3/Record/CustomerID, '9') ) & '</a>' )
While this is syntactically correct, it is difficult for a human to read. It is much easier to read if you add some line breaks and spacing:
IF (Source/S3/Record/CustomerExists, '',
'<a href= "http://localhost/magicxpi4/MGrqispi.dll?appname=IFSmagic xpi_course&prgname=HTTP&arguments=
-ARequestConfirmation%23add_customer&RequestNum=' &
Trim (Str( F.HTTP_Request_Num,'5')) & ' "> ' &
Trim ( Str (Source/S3/Record/CustomerID, '9') ) &
'</a>' )
Here is how you format an expression in Magic xpi.
Formatting an expression:
-
Zoom to the Expression Editor from the button.
-
You can press Enter, and a line break will appear in the expression. You can also add spaces to indent text as desired.
-
When you are done, click OK, the X box on the upper right, or press Escape.
Note:
|
When you add line breaks, this does in fact add a CRLF (Carriage Return and Line Feed character) to the expression. This doesn’t matter to Magic xpi.
|
|