Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi!
i have a table of customers. What i wish to do is run a loop on an external HTML source whereby it loops through the customers in my table. i have replaced the actual customernumber in the html syntax with the variable i have created however this does not work.
has anyone done something similar?
so condition here would be that load all the webtables for the two customers in my masterrecord, if they dont exist there stop the loop.
LoopTable:
LOAD * INLINE [
CustomerNo,Category
5564901246,A
5564901347,B
];
Let NoOfRows = noofrows('LoopTable');
For x = 0 to NoOfRows -1
Let vCustomerNo = peek('CustomerNo', x, 'LoopTable'); //Customer No
LOOP
LOAD F1,
F2,
F3,
F4,
F5,
F6
FROM
'[http://www.allabolag.se/$(vCustomerNo)/bokslut]' //the number 55564901347 is here instead of the variable.
(html, codepage is 1252, embedded labels, table is @7);
Hi.
It should work.
The problem is with the number. I get the error:
"The requested URL /55564901347/bokslut was not found on this server."
For me the script below works but only for 5564901246
For 5564901347 I get
Cannot locate table in HTML file
LOAD F1,
F2,
F3,
F4,
F5,
F6
FROM
[http://www.allabolag.se/5564901347/bokslut]
(html, codepage is 1252, embedded labels, table is @7)
LoopTable:
LOAD * INLINE [
CustomerNo,Category
5564901246,A
5564901347,B
];
Let NoOfRows = noofrows('LoopTable');
For x = 0 to NoOfRows -1
Let vCustomerNo = peek('CustomerNo', x, 'LoopTable'); //Customer No
LOAD F1,
F2,
F3,
F4,
F5,
F6
FROM
[http://www.allabolag.se/$(vCustomerNo)/bokslut] //the number 55564901347 is here instead of the variable.
(html, codepage is 1252, embedded labels, table is @7);
next;
hi Whiteline
thanks for your reply.
test this code with the correct values;
however the loop stops after the first customer hit, is there any reason for this, and also shows error in the loop but processes in any case:
best
Brad
The problem is with for syntax.
FOR ... TO ...
LOOP
LOAD
...
FROM ....
NEXT
Look at QV help for details.