Query_Lang-SystemFunctions_System_PosPos_AD

您正在阅读的是 19.1. 版本。关于最新版本,请前往 Query_Lang-SystemFunctions_System_Pos((Pos))_AD 阅读 21 版本

Parent page: System Query Functions - System Functions

Summary

Returns the index value of the first character in a specified substring that occurs in a given string.

Syntax

Pos(Substr : String , S : String) : Integer

Pos searches for a substring, Substr, within a string, S. Substr and S are string-type expressions. An integer value is returned that is the index of the first character of Substr.

Pos is case-sensitive. If Substr is not found, Pos returns zero.

Example Usage

Pos('T',Name) = 1
Returns all objects that have a Name property whose associated string first contains 'T' at its first position; 'T1' and 'Time Table' are examples of such strings. ('T' is located twice within the string 'Time Table', but the first location of this is at its first position.)

Pos('A',Name) = 2
Returns all objects that have a Name property whose associated string first contains 'A' at its second position; 'RA1' and 'CABLE CHART' are examples of such strings.

Pos('B',Name) = 0
Returns all objects that have a Name property whose associated string does not contain 'B' at any position; 'D1' and 'Time Table' are examples of such strings. (The string of 'Time Table' contains 'b' at its eighth position, but Pos is case-sensitive.)

Pos('D',Name) > 0
Returns all objects that have a Name property whose associated string contains 'D' at at least one position and at any location(s); 'Data Chart', 'U1D', and 'Install either D1 and D2 or D3 and D4, but never install all of these.' are examples of such strings.

Pos('Con',Name) = 1
Returns all objects that have a Name property whose associated string first contains 'Con' at its first, second, and third positions; 'Concatenate' is an example of a such string. (The first location of 'Con' within 'Concatenate' is the first three characters of this; the first character within 'Con' is 'C', and its location is the first character of 'Concatenate'.)

Pos('ate',Name) = 5
Returns all objects that have a Name property whose associated string first contains 'ate' at its fifth, sixth, and seventh positions; 'Concatenate' is an example of a such string. (The first location of 'ate' within 'Concatenate' is the fifth through to seventh characters of this; the first character within 'ate' is 'a', and its location is the fifth character of 'Concatenate'.)

Pos('ate',Name) = 0
Returns all objects that have a Name property whose associated string does not contain 'ate' anywhere; 'C1' and 'TIME:' are examples of such strings.

 

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.

软件的功能取决于您购买的Altium产品级别。您可以比较Altium Designer软件订阅的各个级别中包含的功能,以及通过Altium 365平台提供的应用程序所能实现的功能。

如果您在软件中找不到某个讨论过的功能,请联系Altium销售团队以获取更多信息。