Goto website, but not end program?

Previous topic - Next topic

Ian Price

I've been using -
Code (glbasic) Select
NETWEBEND "http://www.iprice.remakes.org/micro/microsite.html"
- to visit my site (in this example), which also exits the app.

One reviewer left feedback for a webOS app that said he'd rather the app didn't end so that he could return to it after visiting the website - he stated that the app should multi-task. And I agreee.

Is it possible to pause the app, visit a site, then come back to it? The web and networking part of GLB is not a strong point, so I might have missed this. If not, is it possible to implement?

I'm not using ALLOWESCAPE TRUE/FALSE.
I came. I saw. I played.

Kitty Hello

I think you can control that with AUTOPAUSE or ALLOWESCAPE.
I'd start with ALLOWESCAPE FALSE -> that should leave the program open (and send GLB_ON_PAUSE messages)

Ian Price

#2
ALLOWESCAPE FALSE doesn't seem to work on Windows (for this instance) - I've tried it.

I'll try AUTOPAUSE now. :)


[EDIT] Neither have any effect in stopping program from exiting on Windows.
I came. I saw. I played.

MrTAToad

What I do is call the relevant PDK C function

Ian Price

QuoteWhat I do is call the relevant PDK C function
Which is how, exactly?

And would it work on Windows/iPhone?
I came. I saw. I played.

Kitty Hello

Are you using V10 RC?
I checked my code and ALLOWESCAPE FALSE should work on windows certainly.

Ian Price

#6
No, sorry, still using V9.XX. I didn't know V10 RC was out.

To the download-mobile, Batman!

[EDIT] That RC download link still states that it's BETA when running the upgrader. ???
I came. I saw. I played.

Ian Price

OK. Stupid moment there. The reason it wasn't returning to the game on Windows was because I put it at the end of a function, without calling the next one. D'oh! Fixed that and it does indeed work on Windows. However, it still doesn't work on the Pre. The web is called and the program ends. It doesn't seem to matter whether you use ALLOWESCAPE FALSE and/or AUTOPAUSE TRUE.

I came. I saw. I played.

MrTAToad

QuoteWhich is how, exactly?

And would it work on Windows/iPhone?
It wouldn't work on Windows, of course - you would need to use ?IFDEF.  I use :

Code (glbasic) Select
FUNCTION callWebSite%:url$
?IFDEF WEBOS
INLINE
PDL_LaunchBrowser(url_Str.c_str());
ENDINLINE
?ELSE
NETWEBEND url$
?ENDIF
ENDFUNCTION


Although if it's running you dont need the above code :)

Ian Price

Windows is running now, but not WebOS. I'll have a play with that tomorrow (going to work in a few mins).

Cheers MrTAToad.

BTW Is it TAT - TOAD. OR TATE OWED? Always wondered. I know your real name, but not your nick! :S
I came. I saw. I played.

MrTAToad

Its short for Tickle A Toad

Ian Price

I'm not even going to ask! :P
I came. I saw. I played.

Ian Price

MrTAToad - I get an error when trying to compile your code for WebOS in v10.X. The code compiles for Windows, but not for Pre.

Quote
FUNCTION callWebSite%:url$
?IFDEF WEBOS
INLINE
   PDL_LaunchBrowser(url_Str.c_str());
ENDINLINE
?ELSE
   NETWEBEND url$
?ENDIF
ENDFUNCTION

Am I missing something? This inline stuff is pretty much alien to me nowadays.
I came. I saw. I played.

Kitty Hello

#13
try:

Code (glbasic) Select

LOCAL url$="http://www.glbasic.com"

?IFDEF WEBOS
IMPORT int PDL_LaunchBrowser(const char* url);
PDL_LaunchBrowser(url$); // url$ <- we're not INLINE - silly me!
?ENDIF


... but it really should work with the NETWEBEND.

Ian Price

It works (MrTAToad's code) on Windows - the music even continues in the background while browsing, but not on Pre. There's no music and the app terminates when you exit the browser.

I'll try your code now Gernot. :)
I came. I saw. I played.