iOS Question one module to open different files on click

kozbot

Member
Licensed User
Longtime User
I have one pdf file to load per button click (7 in all) that I would like to be opened from different buttons on the module before. Is it possible to go to another module from there, that has something like:

B4X:
If ModuleBefore.button3_click = True Then
        pg.Title = "ModuleBefore"
        WebView1.LoadUrl("ModuleBefore.pdf")
Else If ModuleBefore2.button4_click = True Then   
        pg.Title = "ModuleBefore2"
        WebView1.LoadUrl("ModuleBefore4.pdf")
End If

So if the module before has button 3 clicked, then open this file in the new module, else if module before has button 4 clicked, then open this file in new module, etc... etc...

The only reason I ask this, is cos I don't want to have 50 million modules with 1 webview per module, I have about 150 webview files to look at in this app.

When I do compile the above code, I get the error:
An error occurred:
(Line: 43) 43
java.lang.StackOverflowError

TIA
 

kozbot

Member
Licensed User
Longtime User
Hi Erel, Thank you for getting back to me.

After looking at the tutorial, I'm still unsure how to make it work. Sorry to ask for an example in this instance, but I'm a little lost.

In addition to the above, the example for Tick-Tack-Toe for B4a doesn't seem to work, I can't see any "X" or "O" for the players. I have a Nexus 6 that I'm testing on.

Thanks.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
In addition to the above, the example for Tick-Tack-Toe for B4a doesn't seem to work, I can't see any "X" or "O" for the players. I have a Nexus 6 that I'm testing on.
That's strange. I've just tested it on a Nexus 5 running Android 6 and it works.

Check the SecondExample from the beginner's guide: https://www.b4x.com/b4i/documentation.html
 
Upvote 0

kozbot

Member
Licensed User
Longtime User
Sorry, what am I looking at when it comes to this example? I don't even know what it's called what I'm meant to be looking at. Sorry Erel.
 
Upvote 0

kozbot

Member
Licensed User
Longtime User
Ah... the example worked after a while... not sure why it was unhappy about it in the first instance...

I'm still so confused as to how to implement it in my own code. I've tried the Button Click code, but it doesn't like what I'm doing. I'm totally lost. A point in the right direction would be great.

Thanks.
 
Upvote 0
Top