Goto website, but not end program?

Previous topic - Next topic

Ian Price

#15
Nope, your code (or a variant) fails to compile on WEBOS too Gernot.

Code (glbasic) Select

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.
I came. I saw. I played.

Kitty Hello

See my fix in ma post. Silly me. You need to call with url$ not url_Str - you're not INLINE.

Ian Price

I did already. Your edit still does not compile (see my post above). :(
I came. I saw. I played.

MrTAToad

#18
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!) :

Code (glbasic) Select
?IFDEF WEBOS
IMPORT "C" int __stdcall PDL_LaunchBrowser(const char* url);
?ENDIF

?IFDEF WEBOS
PDL_LaunchBrowser("www.glbasic.com");
?ENDIF

SHOWSCREEN
KEYWAIT

Ian Price

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?
I came. I saw. I played.

MrTAToad

#20
INLINE can only be in any source file and in a function.

However, try my modified Gernot code first though :)

Ian Price

#21
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 :)
I came. I saw. I played.

MrTAToad

QuoteI'm not even going to ask!
Probably wise :)

QuoteMany thanks
No problem!