Показать сообщение отдельно
Старый 06.08.2008, 10:54   #7  
Pavel is offline
Pavel
SAP
SAP
 
2,760 / 239 (13) ++++++
Регистрация: 14.12.2001
Адрес: Moscow
Практически бейсик или паскаль.

SEARCH имя таблицы USING индекс
WHERE условие
действие
END

1) Условие - поиск символа в строке, строка – поле «имя номенклатуры» из текущей записи. По справке можно вызвать описание функций обработки строк и примеры использования.
2) Индекс существенно ускорит процесс, когда табличка немаленькая.

Syntax:
Match(Pattern:STR, s:STR): INT
Return value:
INT
Description:
Compares a fixed expression with a text string. If the fixed expression Pattern matches the text s, 1 is returned (true). Fixed expressions are described below.

Example:
Match("sen", "Andersen")-> 1
Match("sen","Schmidt")-> 0
Match("<A?*sen", "Andersen")-> 1

Match("<H?*sen", "Andersen")-> 0
The fixed expression defines the pattern being searched for. The system does not differentiate between lower and upper case.

The following applies to fixed expressions used in connection with the Match function:

x
An ordinary character (not one of those listed below) is to be matched.

\
A backslash causes a specific character to be matched. "\$" therefore matches a dollar sign.

< or ^
A "less than"sign or a circumflex at the start of an expression is used to match the start of a line.

> or &
A "greater than"sign or an Ampersand at the end of the expression is used to match the end of a line.

? or .
A question mark or a full stop will match any character (except Return, new line).

:a
A colon specifies a group of characters, indicated by the character which immediately follows, to be matched. ":a" sets the match to alpha characters, ":d" to numeric characters, ":n" to alphanumeric characters, ": " to blanks, tabulations and control characters such as Return (new line).

*
An expression followed by an asterisk requires a match for none or several occurrences of the expression. "fo*" will locate "f", "fo", "foo" etc.

+
An expression followed by a plus sign specifies a match is to be found for one or several occurrences of the expression. "fo+" matches "fo" etc.

-
An expression followed by a minus sign requires a match for no or one occurrence of the expression.

[]
A string of characters enclosed within square brackets specifies that a match is required for every character in this text, but no other characters. If the first character in the text is a circumflex, the expression matches every character except for Return, new line and the characters in the string. "[xyz]" matches "xx" and "zyx", while "[^xyz]" matches "abc", but not "axb". A string of characters can be specified with two characters separated by `-'. Note that [a-z] matches characters whereas [z-a] never matches.

"[xyz]" matches "xx" and "zyx", while "[^xyz]" matches "abc", but not "axb". A string of characters can be specified with two characters separated by `-'. Note that [a-z] matches characters whereas [z-a] never matches.
A combination of fixed expressions is itself known as a fixed expression.