The usual use of Template During/Execute code, is to insert HTML or data directly into the body of a page.
The contents of the page, between the opening and closing During/Execute tags, will be passed into the During/Execute subroutine. This allows the subroutine to behave differently for different data or different circumstances.
The contents of the template, between the opening and closing tags (%X SubroutineName% and %/X%) can contain any other Freedombase tag. Any other Freedombase tag will be evaluated before the During/Execute subroutine is executed. This allows data from the database to be passed into the During/Execute subroutine.
For example:
The Customer's Preferred Image, Based On Customer Type, Is: <img src="%X GETIMAGE_SUBROUTINE%EXAMPLES_CUSTOMER_TYPE%/X%">
The During/Execute subroutine could be:
SUBROUTINE GETIMAGE_SUBROUTINE(TemplateName,Command,User,DatabaseClassList,KeyList,InstanceList, ErrorMessageList,SequenceList,NoUpdateFlagList,iSearchFlag,DataIn,ExecuteResponse,iMetaErrorFlag)
ExecuteResponse = ''
BEGIN CASE
CASE DataIn = 'P' ; * Customer Type is Private
ExecuteResponse = 'privateimage.gif'
CASE DataIn = 'B' ; * Customer Type is Business
ExecuteResponse = 'businessimage.gif'
CASE 1
ExecuteResponse = 'unknowntype.gif'
END CASE
RETURN
| previous | next |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

