Re: Attempting to subscript an atom
- Posted by "Lucius L. Hilley III" <lhilley at CDC.NET> Dec 06, 1999
- 473 views
> ---------------------- Information from the mail header ----------------------- > Sender: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> > Poster: David Roach <roachd_76 at YAHOO.COM> > Subject: Attempting to subscript an atom > -------------------------------------------------------------------------- ----- <SNIP> > -- code with the problem > integer pick > atom dcard1,dcard2,pcard1,pcard2 > > pick = rand(52) > dcard1 = Deck[pick] > drawBitmap(BlackJack,dcard1,45,45) <SNIP> > > David Roach > roachd_76 at yahoo.com > dcard2 is an atom (a number) dcard2 = 45 -- or some other number. You are attempting to index into the number as if it was a sequences. sequence s s = {12, 45} dcard2 = s[2] -- now dcard2 = 45 ? dcard2[2] --this will fail because dcard2 is an atom, not a sequence -- of length 2 or greater. -- dcard2 only holds a singe value. Lucius L. Hilley III lhilley at cdc.net +----------+--------------+--------------+ | Hollow | ICQ: 9638898 | AIM: LLHIII | | Horse +--------------+--------------+ | Software | http://www.cdc.net/~lhilley | +----------+-----------------------------+