1. Thierry Garrigues
  2. PowerBuilder
  3. Thursday, 11 January 2024 15:39 PM UTC

Hi.

We use the Inet object to find out if the application has access to the Internet:

inet ln_inet
if getContextService("Internet", ln_inet ) = -1 then return -1

In PowerBuilder 2022r3, what do you recommend I use to replace this code?

Thanks

 

Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 11 January 2024 19:08 PM UTC
  2. PowerBuilder
  3. # 1

You could use the HttpClient object to get the Google home page. The SendRequest function will return -3 if there is no internet.

 

 
Comment
  1. Armeen Mazda @Appeon
  2. Friday, 12 January 2024 16:49 PM UTC
What's good about Roalnd's suggestion is that you are not using an obsolete feature that in near future you will need to rewrite anyway. Might as well clean up the code now if it is not a lot of effort.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 January 2024 16:02 PM UTC
  2. PowerBuilder
  3. # 2

Hi Thierry;

  There is no reason to replace that code as both the iNET object and the GetContextXxxxxx() commands are still valid. The only restriction is that they are not being enhanced but, still good for your App(s) use in this aspect.  HTH   ;-)

Regards .. Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.