流程中的【get rocrod】運算圖標中的代碼如圖21-13所示。
圖21-13 【get rocrod】運算圖標中的代碼
該代碼能夠完成如下的功能:
(1)取得用戶在熱區中單擊的行數所對應的用戶的信息,并將用戶名和存放目錄保存到username變量和studentdirectory變量中。
(2)將userlist變量中用戶單擊某行的信息刪除,并寫回到users.txt文件中。
及時點評 userlist變量中的內容是程序進入時從recordslocation目錄下讀入的users.txt文本中的內容。從users.txt中刪除某行又寫回users.txt文件,自然從users.txt文件中刪除了某行記錄。
【get file list】運算圖標中的代碼如圖21-14所示。
圖21-14 【get file list】運算圖標中的代碼
代碼段中的第1句表示將studentdirectory文件夾下的所有文件名以字符串的形式賦予deletefiles變量。
第2句表示將deletefiles變量中保存的文件名個數賦予numberfiles變量。
新聞熱點
疑難解答