內容列表(Table of Contents)


17. 選用的字串詞集(The optional String word set)


17.1 介紹(Introduction)


17.2 附加的專有名詞和記號(Additional terms and notation)

無(None).


17.3 附加的使用需求(Additional usage requirements)

將表格 17.1 加進表格 3.5.

Append table 17.1 to table 3.5.

參閱: 3.2.6 環境的詢問

See: 3.2.6 Environmental queries

表格 17.1 - 環境詢問字串

字串           值     資料型別    常數?       意義
------         ---------------    ---------   -------
STRING          flag              no          字串詞集存在
STRING-EXT      flag              no          字串延伸詞集存在

Table 17.1 - Environmental query strings

String         Value data type    Constant?   Meaning
------         ---------------    ---------   -------
STRING          flag              no          string word set present
STRING-EXT      flag              no          string extensions word set present


17.4 附加的文件需求(Additional documentation requirements)

無(None).


17.5 遵守標準和命名(Compliance and labeling)


17.5.1 ANS Forth 系統(ANS Forth systems)

措辭 提供字串詞集 必須被加到任何提供字串詞集的標準系統的描述之中.

The phrase Providing the String word set shall be appended to the label of any Standard System that provides all of the String word set.

措辭 從字串延伸詞集提供 name(s) 必須被加到任何提供部分字串延伸詞集的標準系統的描述之中.

The phrase Providing name(s) from the String Extensions word set shall be appended to the label of any Standard System that provides portions of the String Extensions word set.

措辭 提供字串延伸詞集 必須被加到任何提供所有字串詞集和字串延伸詞集的標準系統的描述之中.

The phrase Providing the String Extensions word set shall be appended to the label of any Standard System that provides all of the String and String Extensions word sets.


17.5.2 ANS Forth 程式(ANS Forth programs)

措辭 需要字串詞集 必須被加到任何需要系統提供字串詞集的標準程式的描述之中.

The phrase Requiring the String word set shall be appended to the label of Standard Programs that require the system to provide the String word set.

措辭 需要字串延伸詞集中的 name(s) 必須被加到任何需要系統提供部分字串延伸詞集的標準程式的描述之中.

The phrase Requiring name(s) from the String Extensions word set shall be appended to the label of Standard Programs that require the system to provide portions of the String Extensions word set.

措辭 需要字串延伸詞集 必須被加到任何需要系統提供所有字串和字串延伸詞集的標準程式的描述之中.

The phrase Requiring the String Extensions word set shall be appended to the label of Standard Programs that require the system to provide all of the String and String Extensions word sets.


17.6 詞彙表(Glossary)


17.6.1 字串詞(String words)


17.6.1.0170 -TRAILING
dash-trailing STRING
	( c-addr u1 -- c-addr u2 )

如果 u1 大於零, u2 等於 u1 減去由 c-addr u1 指定的字元字串在結尾的空白數目. 如果 u1 是零或整個字串都是由零組成的, u2 是零.


17.6.1.0170 -TRAILING
dash-trailing STRING
	( c-addr u1 -- c-addr u2 )

If u1 is greater than zero, u2 is equal to u1 less the number of spaces at the end of the character string specified by c-addr u1. If u1 is zero or the entire string consists of spaces, u2 is zero.


17.6.1.0245 /STRING
slash-string STRING
	( c-addr1 u1 n -- c-addr2 u2 )

用 n 個字元調整在 c-addr1 的字元字串. 結果的字元字串, 由 c-addr2 u2 所指定的, 開始於 c-addr1 加上 n 個字元, 而且是 u1 減去 n 個字元的長度.

參閱: A.17.6.1.0245 /STRING


17.6.1.0245 /STRING
slash-string STRING
	( c-addr1 u1 n -- c-addr2 u2 )

Adjust the character string at c-addr1 by n characters. The resulting character string, specified by c-addr2 u2, begins at c-addr1 plus n characters and is u1 minus n characters long.

See: A.17.6.1.0245 /STRING


17.6.1.0780 BLANK
STRING
	( c-addr u -- )

如果 u 大於零, 將開始於 c-addr 的字元位置填入 u 個連續的空白字元之值.


17.6.1.0780 BLANK
STRING
	( c-addr u -- )

If u is greater than zero, store the character value for space in u consecutive character positions beginning at c-addr.


17.6.1.0910 CMOVE
c-move STRING
	( c-addr1 c-addr2 u -- )

如果 u 大於零, 從資料空間中的 c-addr1 位址複製 u 個連續的字元到 c-addr2 位址, 從低位址到高位址, 以字元對字元的方式處理.

參閱: A.17.6.1.0910 CMOVE , 17.6.1.0920 CMOVE>


17.6.1.0910 CMOVE
c-move STRING
	( c-addr1 c-addr2 u -- )

If u is greater than zero, copy u consecutive characters from the data space starting at c-addr1 to that starting at c-addr2, proceeding character-by-character from lower addresses to higher addresses.

See: A.17.6.1.0910 CMOVE , 17.6.1.0920 CMOVE>


17.6.1.0920 CMOVE>
c-move-up STRING
	( c-addr1 c-addr2 u -- )

如果 u 大於零, 從資料空間中的 c-addr1 位址複製 u 個連續的字元到 c-addr2 位址, 從高位址到低位址, 以字元對字元的方式處理.

參閱: 17.6.1.0910 CMOVE , A.17.6.1.0920 CMOVE>


17.6.1.0920 CMOVE>
c-move-up STRING
	( c-addr1 c-addr2 u -- )

If u is greater than zero, copy u consecutive characters from the data space starting at c-addr1 to that starting at c-addr2, proceeding character-by-character from higher addresses to lower addresses.

See: 17.6.1.0910 CMOVE , A.17.6.1.0920 CMOVE>


17.6.1.0935 COMPARE
STRING
	( c-addr1 u1 c-addr2 u2 -- n )

比較由 c-addr u1 指定的字串到由 c-addr2 u2 指定的字串. 這個開始於給定的位址的字串字元對字元的被比較, 直到到達較短的字串的長度或是找到一個不同為止. 如果兩個字串是相等的, n 是零. 如果兩個字串到較短的字串長度為止是相等的, 且 u1 小於 u2, n 是負一 (-1), 否則是一(1). 如果兩個字串到較短的字串長度為止是不相等的, 且第一個在由 c-addr1 u1 指定的字串中不相等的字元, 與由 c-addr2 u2 指定的字串中對應的字元, 有一個較低的數字值, n 是負一 (-1), 否則是一(1).

參閱: A.17.6.1.0935 COMPARE


17.6.1.0935 COMPARE
STRING
	( c-addr1 u1 c-addr2 u2 -- n )

Compare the string specified by c-addr1 u1 to the string specified by c-addr2 u2. The strings are compared, beginning at the given addresses, character by character, up to the length of the shorter string or until a difference is found. If the two strings are identical, n is zero. If the two strings are identical up to the length of the shorter string, n is minus-one (-1) if u1 is less than u2 and one (1) otherwise. If the two strings are not identical up to the length of the shorter string, n is minus-one (-1) if the first non-matching character in the string specified by c-addr1 u1 has a lesser numeric value than the corresponding character in the string specified by c-addr2 u2 and one (1) otherwise.

See: A.17.6.1.0935 COMPARE


17.6.1.2191 SEARCH
STRING
	( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 flag )

搜尋由 c-addr1 u1 指定的字串來找由 c-addr2 u2 指定的字串. 如果 flag 是真時, 一個匹配將會在 c-addr3 找到, 而留下的 u3 個字元. 如果 flag 是假時, 表示沒有匹配, 且 c-addr3 是 c-addr1, 且 u3 是 u1.

參閱: A.17.6.1.2191 SEARCH


17.6.1.2191 SEARCH
STRING
	( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 flag )

Search the string specified by c-addr1 u1 for the string specified by c-addr2 u2. If flag is true, a match was found at c-addr3 with u3 characters remaining. If flag is false there was no match and c-addr3 is c-addr1 and u3 is u1.

See: A.17.6.1.2191 SEARCH


17.6.1.2212 SLITERAL
STRING

	解譯: 這個詞的解譯語義是未定義的.
        編譯: ( c-addr1 u -- )

將下列給予的執行時期語義加進目前的定義.

        執行時期:       ( -- c-addr2 u )

傳回一個 c-addr2 u 字串, 它是由 c-addr1 u 在編譯時指定的字元所組成的. 一個程式必須不修改這個被傳回的字串.

參閱: A.17.6.1.2212 SLITERAL


17.6.1.2212 SLITERAL
STRING

	Interpretation: Interpretation semantics for this word are undefined.
        Compilation: ( c-addr1 u -- )

Append the run-time semantics given below to the current definition.

        Run-time:       ( -- c-addr2 u )

Return c-addr2 u describing a string consisting of the characters specified by c-addr1 u during compilation. A program shall not alter the returned string.

See: A.17.6.1.2212 SLITERAL


17.6.2 字串延伸詞(String extension words)

無(None)

內容列表(Table of Contents)
下一章(Next Section)