anOparator Active Member Licensed User Longtime User Apr 12, 2016 #1 Am using Code: File.WriteString(File.DirRootExternal, vp.currentPage & ".txt", stry(vp.currentPage).Text) from Code: Activity.AddMenuItem("Save", "save") for 11 pages. Pages 1 thru 10 are saved but page 10 gets saved as a blank page. This happens on two emulators and on a device. I thought I had it all fixed, but no. Please tell me where the problem was typed. (probably something in the array statement). Thanks for any pointers. Attachments testStdActionBar.zip testStdActionBar.zip 22.2 KB · Views: 276
Am using Code: File.WriteString(File.DirRootExternal, vp.currentPage & ".txt", stry(vp.currentPage).Text) from Code: Activity.AddMenuItem("Save", "save") for 11 pages. Pages 1 thru 10 are saved but page 10 gets saved as a blank page. This happens on two emulators and on a device. I thought I had it all fixed, but no. Please tell me where the problem was typed. (probably something in the array statement). Thanks for any pointers.
mangojack Expert Licensed User Longtime User Apr 13, 2016 #2 Unsure if this solves problem ... again found the your example hard to follow. In Process Globals you have .. Code: Private stry(11) As EditText Then in Activity Create .. Code: stry = Array As EditText(stry0, stry1, stry2, stry3, stry4, stry5, stry6, stry7, stry8, stry9, stry10) stry(10).Initialize("stry") '@@ Remove this Line Remove the last line of above code. Last edited: Apr 13, 2016 Upvote 0
Unsure if this solves problem ... again found the your example hard to follow. In Process Globals you have .. Code: Private stry(11) As EditText Then in Activity Create .. Code: stry = Array As EditText(stry0, stry1, stry2, stry3, stry4, stry5, stry6, stry7, stry8, stry9, stry10) stry(10).Initialize("stry") '@@ Remove this Line Remove the last line of above code.
anOparator Active Member Licensed User Longtime User Apr 13, 2016 #3 yes it does solve saving page 11, thanks a bunch. I had put that line there because of a Warning about initializing stry. I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA Last edited: Apr 13, 2016 Upvote 0
yes it does solve saving page 11, thanks a bunch. I had put that line there because of a Warning about initializing stry. I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA
mangojack Expert Licensed User Longtime User Apr 13, 2016 #4 anOparator said: I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA Click to expand... I know the final product would be a tidy package ... but mainly the excessive rem lines in this and other examples. I did not even try the buttons. Possibly renaming to reflect View Types .. eg: edtPages , edtArrayPages or similar for EditTexts. Unsure if this was just due to testing .. but you define 11 Edit texts, populate them and then assign them to array of edit texts ?. Maybe there's a good reason to do so. Upvote 0
anOparator said: I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA Click to expand... I know the final product would be a tidy package ... but mainly the excessive rem lines in this and other examples. I did not even try the buttons. Possibly renaming to reflect View Types .. eg: edtPages , edtArrayPages or similar for EditTexts. Unsure if this was just due to testing .. but you define 11 Edit texts, populate them and then assign them to array of edit texts ?. Maybe there's a good reason to do so.