Vincent <guest at RapidEuphoria.com> 2004.12.22. 14:30:38 -8h-kor =EDrta:
>
>
> posted by: Vincent <darkvincentdude at yahoo.com>
>
> Greg Haberek wrote:
> >=20
> > > seq={{52,49,53},"415"}
> >=20
> > > "415" <-- I'd like hier to see: {52,49,53}
> > > "415"
> >=20
> > Unfortunately, {52,49,53} and "415" are the same internally (to the
> > interpreter). You have to determine when a sequence is a string and
> > when it is plain data. You'd have to do something like this:
> >=20
> > }}}
<eucode>
> > sequence a
> >=20
> > a = {52,49,53}
> >=20
> > print(1, a) -- outputs {52,49,53}
> > printf(1, "%s", {a}) -- outputs "415"
> >=20
> > </eucode>
{{{
> >=20
> >=20
>
> This should do it also...
>
> }}}
<eucode>
> -- Disiguish a string from a sequence
>=20
> include get.e
> include misc.e
> constant COUT = 1
>=20
> integer halt
> sequence elem elem = {{52,49,53},"415"}
> sequence val val = value(elem[1])
> sequence str str = {val[2], elem[2]}
>=20
> print(COUT, reverse(str))
> halt = wait_key()
> </eucode>
{{{
>
> Vincent
>
Thanks, but I'd like decide from a discretionary sequence,
if one data sequence or string is.
Attila Kondor
--
|
Not Categorized, Please Help
|
|