Hey Mike,
Here are a couple of options that may help.
You can use the StrTrim function to create the tag name. It may be useful to add each struct to a list to keep track of them:
distarray = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600]
distList = List()
foreach element, distarray do begin
catdis = Create_Struct(('catdis' + StrTrim(String(element),2)), [[99,99]])
distList.Add, catdis
endforeach
print, distList
Or you could use an IDL hash to hold the data. Hashes can be very useful in cases like this:
distarray = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600]
distHash = Hash()
foreach element, distarray do begin
distHash['catdis' + StrTrim(String(element),2)] = [[99,99]]
endforeach
print, distHash
Does this help?
|