New topic: hashtag open webpage
<http://forums.realsoftware.com/viewtopic.php?t=46858> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message ScoobyDoo Post subject: hashtag open webpagePosted: Thu Feb 07, 2013 7:54 am Joined: Tue Jun 03, 2008 5:20 pm Posts: 38 hi, I guess I'm doing something wrong with the hashtag formule. I'd like to view a specific webpage, depending on the hashtag... example domain.com/index.cgi#page1 --> webpage1.show domain.com/index.cgi#page2 --> webpage2.show I tried putting code in homepage. App - Open and Session - Open, but it's not doing what I need.. Dim tag As String = Session.HashTag If tag <> "" Then elseif tag = "page1" then webpage1.show elseif tag = "page2" then webpage2.show End If But the code: me.Text = tag does work. So I know the tag is available and reads properly, but it doesn't open a specific page... what's wrong with this approach ? Top imij Post subject: Re: hashtag open webpagePosted: Thu Feb 07, 2013 9:20 am Joined: Fri Sep 30, 2005 8:28 am Posts: 30 Location: Dunfermline, UK Try this in Session, add a new method... Private Sub SwitchPage(tag As String) select case tag case "page1" WebPage1.Show case "page2" WebPage2.Show end select End Sub .. and then call it from both Session.Open and Session.HashTagChanged... Sub Open() me.SwitchPage me.HashTag End Sub Sub HashTagChanged() me.SwitchPage me.HashTag End Sub I take it you've got ImplicitInstance set for your WebPages? _________________ Ian M. Jones IMiJ Ltd http://www.imij.co.uk http://www.ianmjones.com http://twitter.com/ianmjones Top ScoobyDoo Post subject: Re: hashtag open webpagePosted: Thu Feb 07, 2013 3:59 pm Joined: Tue Jun 03, 2008 5:20 pm Posts: 38 dear imij, that works great ! I guess I should dig more into the reference guide about sessions then, as I did not figure this out myself. Indeed ImplicitInstance is set, as this was (I guess) by default, or I did it during programming, can't remember. Thanks for the help ! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
