Strings and the like.

new topic     » topic index » view thread      » older message » newer message

What if something like these were built-in?

-----------------------------------
type whole_number_set(sequence s)
  for A = 1 to length(s) do
    if (s[A] = floor(s[A])) then
      return 0
    end if
  end for

  return 1
end type
-----------------------------------

Then you would be able to specify any range and test it
effeciently such as a byte_set() below.  Of course, these
sets are enforcing that you have a one dimensional sequence.
But that is the whole point of detecting strings.

-----------------------------------
type byte_set(sequence s)-- I.E.: standard ASCII byte STRING !!!
  sequence temp

  if whole_number_set(s) then
    temp = ((s >= 0) and (255 > s))
    return (find(0, temp) = 0)
  else
    return 0
  end if
end type
-----------------------------------


        Lucius L. Hilley III
        lhilley at cdc.net
+----------+--------------+--------------+
| Hollow   | ICQ: 9638898 | AIM: LLHIII  |
|  Horse   +--------------+--------------+
| Software | http://www.cdc.net/~lhilley |
+----------+-----------------------------+

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu