Re: A86: Re: Reading parameters.


[Prev][Next][Index][Thread]

Re: A86: Re: Reading parameters.




Very nice!  But what if the input is a variable?

Stephen Hicks wrote:
> 
> Hmm...  that explains a lot....  Actually, however, i did figure out how to
> read multiple parameters.  It works like this:
> 
> When the function is executed, it loads all the parameters into variables.
> These variables have 3 character names, consisting first of a '$' and then
> a word that tells which parameter # it is.  Therefore, the 2nd parameter
> would be ".db '$',1,0"...  The type is going to match up with the parameter
> type (except for reals - it pushes them to the OP stack, so i'm not quite
> sure about them YET)...  So if you require that both paramters are strings
> (e.g. a StrCat function), you would do something like this:
> 
> ReadParams:
>  ld hl,Param1
>  rst 20h
>  rst 10h
>  call IncAHLTwice    ;not sure on the address....
>    ;AHL now points to the first strig - you could mmldir it somewhere or
> whatever
>  ld hl,Param2
>  rst 20h
>  rst 10h
>  call IncAHLTwice
>     ;Same as above
>     ;Rest of code goes here
> 
> Param1:
> .db $0C,3,$24,0,0
> Param2:
> .db $0C,3,$24,1,0
> 
> Dux Gregis wrote:
> 
> > Oh, and if you're using the command token to read two parameters, make
> > sure you call the appropriate error messages, because the command token
> > won't do it for you like it does with the unary token.
> >
> > What happens, I think, is that the parser wants to multiply the command
> > token by whatever you put: tok(1,2.  But since commands have a null
> > value, it just returns the number, which in the case of two parameters
> > is complex.
> 
> --
> Stephen Hicks
> mailto:shicks@mindspring.com
> ICQ:5453914
> IRC/AIM:Kupopo
> Hopemage:http://www.mindspring.com/~shicks/


Follow-Ups: References: