- Kyle Bengtson
- PowerBuilder
- Monday, 23 May 2022 02:42 PM UTC
I have a situation where I'm creating a text file in my application, successfully closing it using FileClose, then using Run("notepad "+[filename]) to display it. All works well except that when I try to create a 2nd text file after that, the file is locked by PB unless I get out of my app. Below is an abbreviated example of my code. Does anyone know a workaround?
for li_loops = 1 to li_count
li_FileNum = FileOpen("Recipient List.txt", TextMode!, Write!, Shared!, Append!)
//populate ls_email_list variable from database view
FileWriteEx(li_FileNum, ls_email_list)
if li_loops = li_count then
if FileClose(li_FileNum) = 1 then
Run("notepad "+"Recipient List.txt")
end if
end if
next
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.