Insert rules – hidden records or fields  Using @OP tags with grid rules

Chapter 4: Advanced Application Creation

Edit rules – images and values

When you are editing records, there are two options for defining content of target cells:

When selecting an image type, you can enter a path to the image relative to the application server hosting Mobile Web Studio. For example, for the icon_arrow.gif under the images directory in the onepage Web application directory, enter: /onepage/images/icon_arrow.gif. You can also specify a full HTTP URL reference.

When selecting a value type, you can use a syntax that allows you to specify ranges of existing cells, and perform functions (nested if required) on these cells. The syntax is:

<command>(args[, ...])

where <command> is the operation to perform, and args are the arguments to use.

Commands include:

NoteThese commands are described in detail in the sections that follow.

Arguments include:

To specify single-cell content, use this syntax:

$R<x>F<y>

where <x> and <y> are indexes into the cells. For example, $R4F5 specifies record 4, field 5.

You can use the special value 0 as an index to indicate the current value. For example, if you are editing record 6, field 9, $R0F9 refers to record 6, field 9. This is especially useful for rules that edit a number of records or fields at once; it enables you to use a single rule to perform the same operation on a range of cells.

Array arguments use the single-cell syntax, combined so that a range of cells is specified. That is:

$R<x>F<y>[:R<x'>F<y'>]

If the second cell specifier is not present, the array consists of a single cell; if the second cell is specified, the array consists of all the cells in the indicated range. For example, $R5F2:R6F3 indicates records R5F2, R6F2, R5F3, R6F3. Again, use 0 as an index to use the current record or field.

NoteIf a function is expecting an array argument, a scalar is accepted and treated as a single cell array. However, if a function is expecting a scalar argument, an array argument cannot be accepted.


sum

Description

This function sums all arguments, and returns a single result.

Arguments

There can be one or more array arguments. Summation is carried across all the arrays specified (or, if scalars, by simply adding the scalar value to the current summation). Non-numeric values are ignored. The result is returned as a floating point value.

Examples

=sum($R3F4:R7F6)
=sum($R6F4, $R10F8)
=sum(5, $R6F7)

avg

Description

This function sums all arguments, divides the result by the number summed, and returns a single result.

Arguments

There can be one or more array arguments. Summation is carried across all the arrays specified (or, if scalars, by simply adding the scalar value to the current summation). Non-numeric values are ignored, and not added to the count of items summed. The result is returned as a floating point value.

Examples

=avg($R3F4:R7F6)
=avg($R6F4, $R10F8)
=avg(5, $R6F7)

int

Description

This function returns the integer portion of a single scalar argument.

Arguments

There can be only one scalar argument.

Examples

=int(2.5)
=int(=sum($R6F4:R10F8))

diff

Description

This function subtracts the second argument from the first argument.

Arguments

There can be only two scalar arguments.

Examples

=diff($R3F4, $R7F6)
=diff($R3F4, $R7F6)
=diff(5, 3)

div

Description

This function divides the first argument by the second.

Arguments

There can be only two scalar arguments.

Examples

=div($R3F4, $R7F6)
=div($R6F4, 5)
=div(10, 2)

concatenate

Description

This function concatenates all arguments, and returns a single result.

Arguments

There can be one or more array arguments. Concatenation is carried across all the arrays specified (or, if scalars, by simply concatenating the scalar value to the current result).

Examples

=concatenate($R3F4:R7F6)
=concatenate($R6F4, $R10F8)
=concatenate(5, $R6F7)

concatenate2

Description

This function concatenates the second and subsequent arguments, using the first argument as a pad, and returns a single result.

Arguments

The first argument is scalar, and specifies the pad string to be used; there can be one or more subsequent array arguments. Concatenation is carried across all the arrays specified (or, if scalars, by simply concatenating the scalar value to the current result). The pad value is inserted between all concatenated values (but not appended or prefixed).

Examples

=concatenate2(abc, $R3F4:R7F6)
=concatenate(-, $R6F4, $R10F8

min

Description

This function determines the minimum value across all the arguments, and returns a single result.

Arguments

There can be one or more array arguments. Determination is carried across all the arrays specified (or scalar values, if used). Non-numeric values are ignored. The result is returned as a floating point value.

E.xamples

=min($R3F4:R7F6)
=min($R6F4, $R10F8)
=min(5, $R6F7)

max

Description

This function determines the maximum value across all the arguments, and returns a single result.

Arguments

There can be one or more array arguments. Determination is carried across all the arrays specified (or scalar values, if used). Non-numeric values are ignored. The result is returned as a floating point value.

Examples

=max($R3F4:R7F6)
=max($R6F4, $R10F8)
=max(5, $R6F7)




Copyright © 2005. Sybase Inc. All rights reserved. Using @OP tags with grid rules

View this book as PDF