Call a web page

Any IBM i topic that does not fit in another forum
Post Reply
IBMOLIVIER
Posts: 11
Joined: Fri Dec 02, 2022 2:34 pm

Call a web page

Post by IBMOLIVIER »

Hello everyone, I don't know where to post my question.
My question is the following: Can I call a web page via an AS400 program, for example when I use a function key like F5? If yes, how? Could you provide an example of code, please?
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: Call a web page

Post by Scott Klement »

What do you mean by "call a web page"?
IBMOLIVIER
Posts: 11
Joined: Fri Dec 02, 2022 2:34 pm

Re: Call a web page

Post by IBMOLIVIER »

What I mean is opening a web page via the AS400.
For example, I am on the AS400 in a screen, I press F5, and the web page https://www.scottklement.com/forums/pos ... eply&t=528 opens.
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: Call a web page

Post by Scott Klement »

So you want the 5250 emulator to open up a web browser? You aren't expecting the web page to work inside the 5250 emulator, are you?

What are you using to run the 5250 emulator? Is it Windows? Mac? Linux? Mobile?

What 5250 emulator do you use? Is it IBM Client Access? (This is long discontinued -- but so is the AS400 you keep mentioning). Or Access Client Solutions? Or something else, if so what?
IBMOLIVIER
Posts: 11
Joined: Fri Dec 02, 2022 2:34 pm

Re: Call a web page

Post by IBMOLIVIER »

Hello Scott, no, I don't expect the web page to work in the emulator.
I want the emulator to open a web browser.
Yes, it's the IBM 5250 emulator from Client Access, it's on Windows.
IBMOLIVIER
Posts: 11
Joined: Fri Dec 02, 2022 2:34 pm

Re: Call a web page

Post by IBMOLIVIER »

With the following command lines, I was able to open a web browser, except that a DOS window opens first. Maybe you have something else to suggest to me. Here is my code:

STRPCO
MONMSG MSGID(CPF0000)
STRPCCMD PCCMD('start https://www.Google.ca/.')
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: Call a web page

Post by Scott Klement »

If you want something quick and dirty that works only on Windows and only with emulation software that supports STRPCCMD, try this:

Code: Select all

PGM                                                 
  STRPCO                                            
  MONMSG MSGID(CPF0000)                             
  STRPCCMD PCCMD('rundll32 url,FileProtocolHandler +
                  https://www.Google.ca/.')         
ENDPGM                                              
IBMOLIVIER
Posts: 11
Joined: Fri Dec 02, 2022 2:34 pm

Re: Call a web page

Post by IBMOLIVIER »

it's work
tks Scott
Post Reply