Re: type checking ?

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

Bernie Ryan wrote:
> Derek Parnell wrote:
> > A user of Bernie's application must supply a couple of include files.
> > 
> > global constant WhatEver = "some text"
> 
>    Thanks for explaining it.
>    That is exactly what I mean.
>    How can you be sure that a user enters the token WhatEver which
>    represents a string constant and not the string "WhatEver"

Is the missing bit the way that constant is defined?
What if you did something similar to this:
global constant Whatever = fixedText("some text")

where fixedText just appended to allFixedText and returned the index, then useit
could be:
procedure useit(object txt)
   if atom(txt) then
      txt = allFixedText[txt]
   else
      if find(txt,allFixedText) then ?9/0 end if
   end if
end procedure

A smarter solution would be that useit always expects an integer idx param.

Regards,
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu