I've been using -
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 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)
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.
What I do is call the relevant PDK C function
QuoteWhat I do is call the relevant PDK C function
Which is how, exactly?
And would it work on Windows/iPhone?
Are you using V10 RC?
I checked my code and ALLOWESCAPE FALSE should work on windows certainly.
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. ???
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.
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 :
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 :)
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
Its short for Tickle A Toad
I'm not even going to ask! :P
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.
try:
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.
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. :)
Nope, your code (or a variant) fails to compile on WEBOS too Gernot.
LOCAL url$="http://www.glbasic.com"
LOCAL web
WHILE TRUE
PRINT "HELLO",10,10
IF KEY(57) AND web=0
?IFDEF WEBOS
IMPORT int PDL_LaunchBrowser(const char* url);
PDL_LaunchBrowser(url_Str);
?ENDIF
web=1
ENDIF
SHOWSCREEN
WEND
I've turned off explicit declaration.
It comes up with this error -
Quote*** Configuration: WEBOS ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:722cd5f9 - 3D, NET
"test.gbas"(21) warning : probably unassigned variable : url_Str
Wordcount:9 commands
compile+link:
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 3.6 sec. Time: 10:45
Build: 0 succeeded.
*** 1 FAILED ***
This is using GLBasic IDE, Version: 10.013.
Even trying to compile just your (RECENTLY EDITED) code fails.
See my fix in ma post. Silly me. You need to call with url$ not url_Str - you're not INLINE.
I did already. Your edit still does not compile (see my post above). :(
Are you trying to use the INLINE code in the main project file, with regards to my original code ? INLINE cant be used with the main file...
Try this for Gernot's code (and works in the main project file too!) :
?IFDEF WEBOS
IMPORT "C" int __stdcall PDL_LaunchBrowser(const char* url);
?ENDIF
?IFDEF WEBOS
PDL_LaunchBrowser("www.glbasic.com");
?ENDIF
SHOWSCREEN
KEYWAIT
QuoteAre you trying to use the INLINE code in the main project file ?
Your code, yes. Where should it be? I don't know squat about INLINE. I've used only minimal INLINE statements in the past without problem, in the main project file.
Gernot's code (which doesn't use INLINE) doesn't compile (for PRE) either. Even as is. Does it for you?
INLINE can only be in any source file and in a function.
However, try my modified Gernot code first though :)
Your new, adapted code did the trick MrTAToad. Cheers :)
[EDIT]
That really works a treat in a proper application.
:nw:
Many thanks. Cheers just isn't enough :)
QuoteI'm not even going to ask!
Probably wise :)
QuoteMany thanks
No problem!