Check if Edge ist installed

Just starting out? Need help? Post your questions and find answers here.
Oliver13
User
User
Posts: 90
Joined: Thu Sep 30, 2010 6:40 am

Check if Edge ist installed

Post by Oliver13 »

Hi all,

I'm using PB on Windows and would like to force the Edge mode when using the webgagdet.

Is the following approach fail-safe, meaning that no system error message boxes will appear in case Edge is not properly installed ?

Code: Select all

wg= WebGadget(#PB_Any, 0, 00, 780, 510, "",#PB_Web_Edge)
    If IsGadget(wgt)=false
    wg= WebGadget(#PB_Any, 0, 00, 780, 510, ""); Edge not installed, use normal mode
endif
Fred
Administrator
Administrator
Posts: 18199
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Check if Edge ist installed

Post by Fred »

No your check is wrong. If you use PB_Any, you need to check directly the return value with 0 (as IsGadget(0) can actually returns true if you have a numbered gadget 0):

Code: Select all

wg= WebGadget(#PB_Any, 0, 00, 780, 510, "",#PB_Web_Edge)
If wg = 0
    wg = WebGadget(#PB_Any, 0, 00, 780, 510, ""); Edge not installed, use normal mode
endif
User avatar
jacdelad
Addict
Addict
Posts: 2004
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Check if Edge ist installed

Post by jacdelad »

Also wg<>wgt!
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Oliver13
User
User
Posts: 90
Joined: Thu Sep 30, 2010 6:40 am

Re: Check if Edge ist installed

Post by Oliver13 »

Thank you for confirmation, great. I was a little bit in doubt, whether a missing Edge would rise an system error message when initalising a webgadget with flag #PB_Web_Edge
Post Reply