Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Path into a block

From: swhite:ci:bloomington:mn:us at: 13-Jul-2006 15:14

I could swear I have done this, or read it, but I must be making a dumb mistake. I just want to refer to an item in a block of blocks, by an index that is not a literal (1,2, etc) but an integer word that contains the 1, 2, etc. The following demo script returns the following error: (In summary, I can reference <DATA-NAME>/5 ...but not <DATA-NAME>/<index-name> where <index-name> has a value of 5) Thank you. *------ output of demo script *------------------ print type? HTMLCAL-SLOTS/5 block print HTMLCAL-SLOTS/5 &nbsp; &nbsp; print type? HTMLCAL-INDEX integer print HTMLCAL-INDEX 5 print HTMLCAL-SLOTS/HTMLCAL-INDEX ** Script Error: Invalid path value: HTMLCAL-INDEX ** Where: halt-view ** Near: print HTMLCAL-SLOTS/HTMLCAL-INDEX
>>
*------ end of output of demo script *---------- *----------- demo script *------------ REBOL [] HTMLCAL-SLOTS: [ ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ["&nbsp;" "&nbsp;"] ] HTMLCAL-INDEX: 5 print "print type? HTMLCAL-SLOTS/5" print type? HTMLCAL-SLOTS/5 print "print HTMLCAL-SLOTS/5" print HTMLCAL-SLOTS/5 print "print type? HTMLCAL-INDEX" print type? HTMLCAL-INDEX print "print HTMLCAL-INDEX" print HTMLCAL-INDEX print "print HTMLCAL-SLOTS/HTMLCAL-INDEX" print HTMLCAL-SLOTS/HTMLCAL-INDEX *-------- end of demo script--------- Steven White City of Bloomington 1800 W Old Shakopee Rd Bloomington MN 55431-3096 USA 952-563-4882 (voice) 952-563-4672 (fax) steven.white-ci.bloomington.mn.us