Re: type checking ?
- Posted by Bernie Ryan <xotron at bl?efro?.com> Nov 21, 2007
- 633 views
Matt Lewis wrote: > > > }}} <eucode> > > constant > > MySEQ = {1,2,3,4,5,6,7,8,9} > > > > procedure useit(sequence seq_name) > > -- do stuff. > > end procedure > > > > -- The user can enter this which is WRONG > > useit("MySEQ") > > > > -- Or the user can enter this is CORRECT > > useit(MySEQ) > > > > -- NOTE they are both sequences so procedure will accept either. > > > > </eucode> {{{ > > Unfortunately, this hasn't cleared it up for me. I guess that I have a > couple of responses. If the passed value is incorrect, then you can > simply validate it using equal(). Also, if the only correct value is a > specific constant, then why pass it as a parameter at all? That seems > to be just increasing typing for no benefit. > > I suspect that there's something more to this that you haven't made clear > yet. What is the effect of one being WRONG and the other CORRECT? > > What about (in the above example): > }}} <eucode> > useit({1,2,3,4,5,6,7,8,9}) > </eucode> {{{ Matt: 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. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan