Re: type checking ?

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

Bernie Ryan wrote:
> The useit() procedure will try to process the sequence weather it is
> a constant name sequence or the actual constant sequence because they
> depending how the user calls the procedure.
> I do not know in advance what the constant sequence will be because it is
> added by the user via include file. 
> Of course if user passes the name as a sequence the procedure will crash. 
> I will just have to spell it out in the users manual and
> HOPE that they read it. 


I'm still trying to work out Bernie's issue but here's what I've got so far...

Bernie has a file that is something like this ...

------------ start of bernie's file
include userfileA.e

global function/procedure useit(sequence x)
 <some processing goes here>
end function/procedure

include userfileB.e
------------- end of file

And a user of Bernie's application must supply a couple of include files.

------ start of userfileA.e
global constant WhatEver = "some text"
------ end of  userfileA.e

------ start of userfileB.e
useit(WhatEver)
------ end of  userfileB.e

Now the problem is that Bernie want to make sure that in userfileB, the user
codes ...

   useit(WhatEver)

and never codes ...

   useit("WhatEver")

plus allow the user to code ...

   useit("any other text")


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

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

Search



Quick Links

User menu

Not signed in.

Misc Menu