Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exit For inside Load

Dear all, I'm trying to do an exit for inside a load statement and i don't know how to do that.

Basically I'm conecting to google maps to get geodata, but If I have a OVERLOAD_MESSAGE I want to do an exit for



FOR

j = 0 to $(NumberOfZips)

-1

LET

K = peek('vZip', '$(j)', 'tmpzip');

GMAP:



LOAD

text

('$(C)') as COUNTRY,

text

($(K)) as [POSTALCODE],

[result/geometry/location/lat]

AS Latitude,

[result/geometry/location/lng]

AS Longitude

I want to add that



if [result/status]='OVER_QUERY_LIMIT' EXIT FOR



FROM

[http://maps.google.com/maps/api/geocode/xml?address

next



Thanks for your help

3 Replies
vupen
Partner - Creator
Partner - Creator

You were almost there. The syntax is:


For i = 1 to 10
y = i * 5
If y > 40 Then
Exit For
End If
Next


Not applicable
Author

But...

How can I do that inside a load Sentence.

Only I have to exit for if on load contition is true

Best regards.

Miguel_Angel_Baeyens

Hello Jordi,

If I'm not wrong, syntax is

FOR ... EXIT FOR WHEN Field = Value ... NEXT


Regards