Var is going to be equal to the value of the integer in the list, not the
position, and when you use the brackets (I think) in accessing property
lists, it is looking for a positional value. So the first time thru the
repeat loop, it would work, because the var = 2 (which is a position in the
list), but the next time thru, var = 5 (which is outside the range of the
list)...


morgan-

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Gene Fritzinger
Sent: Tuesday, July 31, 2001 6:19 AM
To: [EMAIL PROTECTED]
Subject: <lingo-l> Index out of range error

Hello List,
I'm trying to set mSetCriteria from a list named gGeokeyList from within a
repeat loop. An example of what the list might look like is [2, 5, 7]. I
comment the line at which I get an "Index out of range" error.  Can anyone
see what I'm doing incorrectly?

on mouseUp
  closeTables
  closeDB
  set gDB = 0
  set gTable = 0
  set gDB = new(XTRA "V12dbe", the moviePath & "GEO.v12", "ReadWrite", "top
secret")
  CheckV12Error()
  set gTable = new(Xtra "V12table", mGetRef(gDB), "regmast")
  CheckV12Error()
  repeat with var in gGeokeyList
    x = gGeokeyList[var]  --THIS IS WHERE I GET AN "INDEX OUT OF RANGE"
ERROR
    mSetCriteria(gTable, "PARENT01", "=", x)
    mOrderBy(gTable, "PARENT01")
    mSelect(gTable)
    put mGetSelection(gTable, "LITERAL", 1, mSelectCount(gTable), ", ",
return, "DESCRIPT") after field "RegionSelectedGeographies"
  end repeat

  go to "RegionPop"
  updatestage
end

Thanx in advance,
g fritzinger


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to