FreedomSoft - "the future is freedom"
Template During - Insert

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

previousnext
123456789101112131415161718192021222324252627