1. A sequence, by any other name

Hello all,

What I need is a sure-fire way to determine in my program if a sequence 
is a character sequence versus a sequence of numbers.  I need to 
determine this dynamically. 

Maybe this is a basic question?  I dunno.

Jonas

new topic     » topic index » view message » categorize

2. Re: A sequence, by any other name

type string(sequence x)
  return find(0,x > 255 and x < 0)
end type

it doesn't check if it's not a sequence though...

--- Jonas  Temple <jktemple at yhti.net> wrote:
> Hello all,
> 
> What I need is a sure-fire way to determine in my
> program if a sequence 
> is a character sequence versus a sequence of
> numbers.  I need to 
> determine this dynamically. 
> 
> Maybe this is a basic question?  I dunno.
> 
> Jonas

Hope this is what you're looking for,
-Humberto

new topic     » goto parent     » topic index » view message » categorize

3. Re: A sequence, by any other name

--- codehead78 at YAHOO.COM wrote:
> type string(sequence x)
>   return find(0,x > 255 and x < 0)
> end type
> 
Oops, that should be
return not find(0,x > 255 and x < 0)

> it doesn't check if it's not a sequence though...
> 
> --- Jonas  Temple <jktemple at yhti.net> wrote:
> > Hello all,
> > 
> > What I need is a sure-fire way to determine in my
> > program if a sequence 
> > is a character sequence versus a sequence of
> > numbers.  I need to 
> > determine this dynamically. 
> > 
> > Maybe this is a basic question?  I dunno.
> > 
> > Jonas
> 
> Hope this is what you're looking for,
> -Humberto

new topic     » goto parent     » topic index » view message » categorize

4. Re: A sequence, by any other name

On Tue, 27 Feb 2001, Jonas wrote:
> Hello all,
> 
> What I need is a sure-fire way to determine in my program if a sequence 
> is a character sequence versus a sequence of numbers.  I need to 
> determine this dynamically. 
> 
> Maybe this is a basic question?  I dunno.
> 
> Jonas
 
Depending upon the numbers involved, it may be impossible: 
Consider, for example:

 sequence s
 s = {65,66,67,68}

puts(1,s) -- gives ABCD
? s -- gives {65,66,67,68}
 
Now, 64, 65... etc are perfectly valid numbers, but they may also be 
valid characters. It's up to the programmer to keep track of what those 
numbers are supposed to represent at any given time.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu