假設我的1.xml有以下內容。
& ltpk _ corp & gt0001 & lt;/PK _ corp & gt;
//將文件讀入ls_text
字符串ls_text
Li _ FileNum = FileOpen(" C:\ 1 . XML ",StreamMode!)
FileRead(li_FileNum,ls_text)
FileClose(li_FileNum)
//使用POS攔截
長整型ll_start_pos,ll_end_pos
ll_start_pos = Pos( ls_text," & ltpk_corp >, 1 )
ll_end_pos = Pos( ls_text," & lt/pk_corp >, 1 )
-獲取內容。
字符串ls_value
ls_value = mid(ls_text,ll_start_pos + 9,ll_end_pos - ll_start_pos - 9)
所以可以得到ls_value = '0001 '