Tracking down If statement start and ends

Hi

After a number of years using the reportmagic I find myself trying to track down the start and ends of IF macros so that I can comment on them to make it easier to identify where one is missing or an EndIf is missing. This is now also harder when you are splitting them between the template document and an rmscript.

Is there any recommendations on how to assist in tracking these? Almost like excel where you can see the start and closing brackets in a formula…I may be hoping for too much :slight_smile:

Hi David,

Have you thought about using comment


e.g.

[If: condition=`DeviceCount > 0`, comment=`Device If: Start`]
//do something here
[EndIf: comment=`Device If: End`]

You can search the code for your comment.

There is also Comment and Section macros
They do nothing but add comments and section headings to the results section.

[Section: name=My Section]
[If: condition=`DeviceCount > 0`, comment=`Device If: Start`]
[Comment: do something]
[EndIf: comment=`Device If: end`]

image

In the Word Document we colour code the If / ForEach macros to make them stand out.
image

1 Like

Hi Denise

It was in my efforts to try and put comments in that I was trying to work out where things started and ended in a report that was created by PDL before comments existed.

It was making it harder when I was also trying to transition to a script based template where most of the config will be in scripts but some of the EndIf may be in the template or the script due to the placement of Text etc.

Thanks for the suggestion though