M mackrackit Member Licensed User Longtime User Dec 27, 2023 #1 Hi, I am using the example here as a base. SaveAs Code Snippet I am not using pages, replaced GetBA per instructions. Using a Galaxy Tab A7 Lite with Android version 13 for a testing device. Compiling to SDK version 33. The problem I am having is the file saved using SaveAs is always 0 B in size. I can verify that there is data in the file with Code: Copy Sub ReadString MsgboxAsync(File.ReadString(File.DirInternal, "84_Text.txt"), "") End Sub The SaveAs Code: Copy Private Sub Button1_Click Wait For (SaveAs(File.OpenInput(File.DirInternal, "84_Text.txt"), "text/plain", "84_Text.txt")) Complete (Success As Boolean) Log("File saved successfully? " & Success) End Sub Also tried "application/octet-stream" without a difference. Tried different locations when saving and tried changing and not changing the file name, alway creates a file 0 B in size without content.
Hi, I am using the example here as a base. SaveAs Code Snippet I am not using pages, replaced GetBA per instructions. Using a Galaxy Tab A7 Lite with Android version 13 for a testing device. Compiling to SDK version 33. The problem I am having is the file saved using SaveAs is always 0 B in size. I can verify that there is data in the file with Code: Copy Sub ReadString MsgboxAsync(File.ReadString(File.DirInternal, "84_Text.txt"), "") End Sub The SaveAs Code: Copy Private Sub Button1_Click Wait For (SaveAs(File.OpenInput(File.DirInternal, "84_Text.txt"), "text/plain", "84_Text.txt")) Complete (Success As Boolean) Log("File saved successfully? " & Success) End Sub Also tried "application/octet-stream" without a difference. Tried different locations when saving and tried changing and not changing the file name, alway creates a file 0 B in size without content.
Solution M M mackrackit Dec 28, 2023 Hi drgottjr, I started from scratch with a small project that only wrote a text file and the SaveAs function. Same results. On both attempts this warning was present. Undeclared variable 'ion'. (warning #8) Click to expand... I have read statements similar to " it is only a warning, not to worry". Not this time. I looked at the text editor tutorial and saw where ion was declared. Private ion As Object Click to expand... Added that to my project and Presto! It works! Attached is the simple test program if anyone is interested.
Hi drgottjr, I started from scratch with a small project that only wrote a text file and the SaveAs function. Same results. On both attempts this warning was present. Undeclared variable 'ion'. (warning #8) Click to expand... I have read statements similar to " it is only a warning, not to worry". Not this time. I looked at the text editor tutorial and saw where ion was declared. Private ion As Object Click to expand... Added that to my project and Presto! It works! Attached is the simple test program if anyone is interested.
drgottjr Expert Licensed User Longtime User Dec 28, 2023 #2 the saveas snippet works fine. i just tried it to make sure something hadn't changed while i was sleeping. you've done something that you haven't shown to us. Upvote 0
the saveas snippet works fine. i just tried it to make sure something hadn't changed while i was sleeping. you've done something that you haven't shown to us.
M mackrackit Member Licensed User Longtime User Dec 28, 2023 #3 Hi drgottjr, I started from scratch with a small project that only wrote a text file and the SaveAs function. Same results. On both attempts this warning was present. Undeclared variable 'ion'. (warning #8) Click to expand... I have read statements similar to " it is only a warning, not to worry". Not this time. I looked at the text editor tutorial and saw where ion was declared. Private ion As Object Click to expand... Added that to my project and Presto! It works! Attached is the simple test program if anyone is interested. Attachments SaveAs_Test.zip SaveAs_Test.zip 9.9 KB · Views: 495 Upvote 0 Solution
Hi drgottjr, I started from scratch with a small project that only wrote a text file and the SaveAs function. Same results. On both attempts this warning was present. Undeclared variable 'ion'. (warning #8) Click to expand... I have read statements similar to " it is only a warning, not to worry". Not this time. I looked at the text editor tutorial and saw where ion was declared. Private ion As Object Click to expand... Added that to my project and Presto! It works! Attached is the simple test program if anyone is interested.