跳轉到內容

Rexx 程式設計/Rexx 指南/大小寫敏感

來自華夏公益教科書,自由的教學讀物

識別符號和關鍵字

[編輯 | 編輯原始碼]

Rexx 直譯器不區分大小寫。這意味著包含小寫字母的識別符號名稱和關鍵字被視為與包含大寫字母的那些相同。

/* These variables are all the same */
count = 1
Count = COUNT + 1
say count

文字字串

[編輯 | 編輯原始碼]

文字字串中保留字母大小寫。

say 'Hello!'  /* Hello! */
SAY 'HELLO!'  /* HELLO! */

字串比較

[編輯 | 編輯原始碼]

在 Rexx 中,比較運算子區分大小寫,因此包含不同字母大小寫的字串將不被解釋為匹配字串。

if "abc" = "ABC" then
  say "The strings are the same!"    /* This does not happen because the strings are not the same */
華夏公益教科書