Create Constant in form via web

Hi ,

How can I create Constant in a form to be used in the code , rather than retyping the string .

Any idea ?

Thanks and Regards

Subject: Create Constant in form via web

Dear Hajar ,

Which type of constant u wana use ,Text, numeric or Date type .

****String :

Specify a text constant by enclosing characters, including spaces, numbers, and special characters, in quotation marks (“”) or braces ({}).

Note Braces as text constant delimiters are new with Release 6.

Using braces as text delimiters enables you to enter the text constant “Hello World” as {“Hello World”} instead of “"Hello World"”.

Do not enter variable names in quotation marks or braces, or the names are treated as text.

Enter numbers in quotation marks or braces when you want them treated as text.

To include multiple characters, for example, spaces, use @Repeat.

The backslash ( \ ) serves as an escape character in a text constant. To embed quotation marks in a text constant delimited by quotation marks, precede each embedded quotation mark with a backslash. To embed a right brace in a text constant delimited by braces, precede each embedded right brace with a backslash. To embed a backslash in a text constant, type two backslashes.

A compiled formula does not distinguish between quotation marks and braces. When you open a design element containing formulas, quotation marks delimit all constants including those previously specified with braces. A backward slash prefixes a quotation mark previously specified in a constant delimited by braces.

Numeric Type*******

A numeric constant consists of numeric and special characters, with no intervening spaces, that conform to the following rules:

Integer – The characters 0 - 9 without intervening spaces comprise a positive integer.

Decimal – A decimal point may be placed before, after, or within the numeric characters.

Sign – The first character of a number may be a plus or minus sign.

Scientific notation – A number may be suffixed by the letter E, an optional plus (default) or minus sign, and an integer.

The table below shows the acceptable formats for entering numbers.

Type of Number Constant Result

Decimal .123 0.123

Integer 123 123

Negative number -123.4 -123.4

Scientific notation 123E2, 123E-2 12300, 1.23

date type****

A time-date constant consists of a time and/or a date enclosed in square brackets formatted as follows:

12-hour time – A time in the format [hh:mm:ss] followed by the letters AM or PM. The hours can range from 00 to 12. The seconds are optional and default to 00.

24-hour time – A time in the format [hh:mm:ss]. The hours can range from 00 to 23. The seconds are optional and default to 00.

Date – A date in the operating system’s default date format. Some examples include:

Region Default date format Entering “[01/02/03]” results in

United States '[mm/dd/yyyy] January 2, 2003

France '[dd/mm/yyyy] February 1, 2003

Japan '[yyyy/mm/dd] February 3, 2001

The year (yyyy) is optional and defaults to the current year. If you use yy to specify a year, in the 20th century, yy is 50 or greater and in the 21st century, yy is less than 50. The validity of a date format depends on the date separator that users choose in their operating system control panel. The default separator for Windows, UNIX, and Macintosh is a slash (/). The default separator for OS/2 is a hyphen (­).

Time and date – A time and a date in the format [time date] or [date time].

If time-date values are subtracted, the result is an integer that represents the difference between the times in seconds.

The table below shows the formats you can use to specify a date in a Notes field, assuming the operating system’s default date format is US English and the year is 2002.

Tip Display Time must be selected in the Date/Time field properties box for the time to display. It is not selected by default.

Time-date format Constant Date/Time field result Text field result

24-hour time [5:30] 05:30 AM 05:30:00 AM

12-hour time [5:30 PM] 05:30 PM 05:30:00 PM

24-hour time [17:30] 05:30 PM 05:30:00 PM

Date [6/15] 06/15/2002 06/15/2002

Date [6/15/02] 06/15/2002 06/15/2002

Time-date [6/15 5:30 PM] 06/15/2002 05:30 PM 06/15/2002 05:30:00 PM

Time-date [5:30 PM 6/15] 06/15/2002 05:30 PM 06/15/2002 05:30:00 PM

Difference [5:30 PM]-[5:30] 43200.00 43200

Specifying time zones

To specify a time zone in a Time zone field, you can select a zone from a drop-down list of options or use the functions @TimeZoneToText and @TextToTimeInZone to manipulate the formats in which time values display programmatically.

Notes converts and saves human-readable time zone values using the following time zone attributes:

Attribute Definition

Z Time zone offset from GMT.

DO Daylight Saving Time (DST) observed flag. 1 means DST is in effect; 0 means it is not. If equal to 1, a value should be supplied for DL.

DL DST law identifying the .

ZX (Optional) Host-specific time zone index.

ZN (Optional) Time zone name.

For example, if you select “(GMT -05:00) Eastern Time (US & Canada)” from the Time zone drop-down list, Notes saves the value as:

Z=5$DO=1$DL=4 1 1 10 -1 1$ZX=25$ZN=Eastern

This indicates that the time zone is 5 hours before Greenwich Mean Time (-5). DST is in effect and starts in the month of April(4), during week 1, on day 1 of the week, which is a Sunday, and ends in October(10), during the last week (-1), also on a Sunday(1). The ZX and ZN attributes are values used exclusively by Notes.

If you use a Time zone field as the default value for a view column, it displays as a similar string of attribute and value pairs. Use @TimeZoneToText to convert the field to a human-readable format.

You can enter these attribute and value pairs as the default value for a Time zone field, or you can let the @TimeToTextInZone function do the work for you. For example, to display a box specifying the current time in Alaska, you could create a Hotspot button with this formula:

@Prompt([Ok];“Current time in Alaska”;@TimeToTextInZone(@Now;“Z=9$DO=1$DL=4 1 1 10 -1 1”))

or you could create a Time zone field called zone from which the user could select the zone for which they would like to see the current time, then display that time in a message box by adding this formula to the Hotspot button:

@Prompt([Ok];“Current time there”;@TimeToTextInZone(@Now;zone))

Rishi

Subject: RE: Create Constant in form via web

Hi ,

Thanks alot …

But I guess I wasn’t clear in my question , I was looking for global constant . were I can use it in the event function , or as defult value in the field ?