Rexx - 字串



此函式用於一次從檔案中讀取一個字元。有時程式需要逐字元讀取檔案,因此此函式可用於此目的。

語法

charin(filename)  

引數

  • filename − 這是需要從中讀取字元的檔案的名稱。

返回值

從檔案中讀取的一個字元。

示例

/* Main program */ 
chr = charin(Example.txt) 
say chr 

chr = charin(Example.txt) 
say chr 

chr = charin(Example.txt) 
say chr  

執行上述程式後,我們將得到以下結果。

輸出

E 
x 
a 
rexx_functions_for_files.htm
廣告

© . All rights reserved.