Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with the GetURL in PB8

Status
Not open for further replies.

ShyamPB

IS-IT--Management
Aug 20, 2004
1
US
I'm new to PB and my requirement is to get data from a URL. I'm using the following code. Could someone help me why isn't that working. (PB 8)

Inet iinet_base
iinet_base = CREATE Inet
InternetResult data
data = CREATE InternetResult
integer k
k = iinet_base.GetURL(" data)
MessageBox("result",string(data))

Is this the correct way to get Internet data? Any examples as how we can get the data from URL would be helpful.

Thanks
 
From the books online:

Getting a URL
You call the Internet service's GetURL function to perform an HTTP Get, returning raw HTML for a specified URL. This function returns the raw HTML via the InternetResult object.

To perform an HTTP Get:

1 Declare an instance or global variable of type Inet. Also declare an instance or global variable using the descendent InternetResult object as the data type (n_ir_msgbox in this example):
Inet iinet_base
n_ir_msgbox iir_msgbox

2 Create the Internet service by calling the GetContextService function:
THIS.GetContextService("Internet", iinet_base)

3 Create an instance of the descendent InternetResult object:
iir_msgbox = CREATE n_ir_msgbox

4 Call the GetURL function, passing the URL of the page to be returned and a reference to the instance of the descendent InternetResult object:
iinet_base.GetURL &
(" iir_msgbox)

When the GetURL function completes, it calls the InternetData function defined in the descendent InternetResult object, passing the HTML for the specified URL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top