Home/Support/Support Forum/PBuilder Prevent duplicate code blocks
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

PBuilder Prevent duplicate code blocks

0 votes
Hi,

Trying to get my head around the way RpIdentifier works in the Pbuilder preprocessor.

Assume in my web project I have two HTML files:
Code:
index.html <!-- RpDataZeroTerminated RpIdentifier=myFooter --> Footer Content <!-- RpEnd --> other.html <!-- RpDataZeroTerminated RpIdentifier=myFooter --> Footer Content <!-- RpEnd -->

Is there a way to instruct PBuilder to not duplicate the output in the generated code? Now I find myself having to remove redefined char arrays to get the project to compile. Which is a hassle when trying to rapidly prototype projects.

For example if I run PBuilder on the above I will have something like this in my .c output file.
Code:
char myFooter[] = "Footer Content"; char myFooter[] = "Footer Content";
asked Sep 20, 2011 in NET+OS by gpotter New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
Use the RpItemGroup construct to define the first instance:
<!-- RpItemGroup RpIdentifier=myFooter -->
<!-- RpDataZeroTerminated -->
Footer Content
<!-- RpEnd -->
<!-- RpLastItemInGroup -->


Then reference it elsewhere:
<!-- RpUseIdentifier RpIdentifier=myFooter RpItemType=ItemGroup -->
Standard footer
<!-- RpEnd -->
answered Sep 21, 2011 by steved2 Seasoned Professional (151 points)
...