Skip to Content
author's profile photo Former Member
Former Member

Constants for all

Hi,

i want to know if is it possible to create a file with constants which can be used for all pages of a bsp application (globals constants) ? Or is there another way to do this ?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2004 at 03:20 PM

    Hello,

    your could define constants as attributes in your application class.

    How do you like this?

    Regards, Bernd

    Add a comment
    10|10000 characters needed characters exceeded

    • One way is as constants of the application class. However, constants can be defined on <b>any</b> class. So just create a small class, call it CL_MY_CONSTANTS, and define all the constants on that class. You can also define constants on interfaces. For an example, see IF_BSP_WRITER.

      Alternatively, just define the constants inside a page fragment.

      <%
        constants CO_RED   type C value 'R'.
        constants CO_GREEN type C value 'G'.
        constants CO_BLUE  type C value 'B'.
      %>
      

      Now you can include this page fragment in all pages (effectively expanded inline) and just refer to the constants.

      <%@include file="myConstants.htm"%>
      <%=CO_RED%>
      

      ++bcm

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2004 at 12:19 PM

    Thanks a lot

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.