Almora Well-Known Member Licensed User Longtime User Mar 9, 2017 #1 I could not work to change the article by clicking forward and back. It's only going once. how can I do it. next button B4X: For i = 1 To 3 step 1 Label1.Text=File.ReadString(File.DirAssets, i & ".text") next back button B4X: For i = 3 To 1 step -1 Label1.Text=File.ReadString(File.DirAssets, i & ".text") next Attachments test.zip 8.2 KB · Views: 145
I could not work to change the article by clicking forward and back. It's only going once. how can I do it. next button B4X: For i = 1 To 3 step 1 Label1.Text=File.ReadString(File.DirAssets, i & ".text") next back button B4X: For i = 3 To 1 step -1 Label1.Text=File.ReadString(File.DirAssets, i & ".text") next
DonManfred Expert Licensed User Longtime User Mar 9, 2017 #2 For what you need a loop if you only want to set the text from one file to the Label? Your first code will put the B4X: "3.text" into your label Your second code will put the B4X: "1.text" into your label Upvote 0
For what you need a loop if you only want to set the text from one file to the Label? Your first code will put the B4X: "3.text" into your label Your second code will put the B4X: "1.text" into your label
Almora Well-Known Member Licensed User Longtime User Mar 9, 2017 #3 You have a code sample. I could not.. Upvote 0
klaus Expert Licensed User Longtime User Mar 9, 2017 #4 Before getting a code sample you must explain more in detail what exactly you want to do! I could not work to change the article by clicking forward and back. Click to expand... What does clicking forward and back mean. Clicking where on what? Upvote 0
Before getting a code sample you must explain more in detail what exactly you want to do! I could not work to change the article by clicking forward and back. Click to expand... What does clicking forward and back mean. Clicking where on what?
Almora Well-Known Member Licensed User Longtime User Mar 9, 2017 #5 When I click on the button, I get the text files in the label. next(forward) button click =1.txt(label) next(forward) button click =2.txt(label) next(forward) button click= 3.txt(label) ..... back button click =3.txt(label) back button click =2.txt(label) back button click= 1.txt(label) ..... ..... Upvote 0
When I click on the button, I get the text files in the label. next(forward) button click =1.txt(label) next(forward) button click =2.txt(label) next(forward) button click= 3.txt(label) ..... back button click =3.txt(label) back button click =2.txt(label) back button click= 1.txt(label) ..... .....
Almora Well-Known Member Licensed User Longtime User Mar 9, 2017 #6 I tried a different method. It works very well. But he wants long code. Is there a shortcut? How to do it with for-next? Attachments test2.zip 8.4 KB · Views: 135 Upvote 0
I tried a different method. It works very well. But he wants long code. Is there a shortcut? How to do it with for-next?
S sorex Expert Licensed User Longtime User Mar 9, 2017 #7 you should work with a counter that you increase or decrease depending on which button is pressed. if button2 is your next button it could be something like this B4X: Sub Button2_Click if counter <3 then counter=counter+1 label1.Text=File.ReadString(File.DirAssets,counter&".txt") End If End Sub Upvote 0
you should work with a counter that you increase or decrease depending on which button is pressed. if button2 is your next button it could be something like this B4X: Sub Button2_Click if counter <3 then counter=counter+1 label1.Text=File.ReadString(File.DirAssets,counter&".txt") End If End Sub
klaus Expert Licensed User Longtime User Mar 9, 2017 #9 How to do it with for-next? Click to expand... How do you want to do it? For/Next loop, what for? Attached a modified project with my vision. Attachments test3.zip 8.2 KB · Views: 157 Upvote 0
How to do it with for-next? Click to expand... How do you want to do it? For/Next loop, what for? Attached a modified project with my vision.
Almora Well-Known Member Licensed User Longtime User Mar 9, 2017 #10 Your method is better. How do you want to do it? For/Next loop, whatfor? Click to expand... I guess I did not need the (for-next) method. Upvote 0
Your method is better. How do you want to do it? For/Next loop, whatfor? Click to expand... I guess I did not need the (for-next) method.