Re: LZ: Weird Trick...


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

Re: LZ: Weird Trick...



> I have also had this happen, but I'm at a loss to explain it.  
> 
> 
> [Way of copying Hexview snipped]


The ANS variable changes types dynamically (thats why you can't have 
anything like ZShell after it in memory).  If you type 15+8, 23 is 
displayed on the screen (surprisingly :) and it is also stored in 
ANS. This means that ANS becomes a REAL.  However, if you type 
"Hello", Hello is displayed ANS becomes a STRING.  So if you type 
Hexview (or sub(Hexview,1,299); they do the same thing), it displays 
the actual machine code stored in the string, therefore making ANS a 
STRING and storing a copy of Hexview in there.  When you run ZShell, 
all it does is search for all of the STRING type variables and checks 
if they contain ZShell programs.  If so, it displays them.


Also, Hexview->A copies Hexview into A and into ANS, creating two new 
ZShell programs.


Sorry for rambling ;), but I hope it helped.






Ben
shakal@ns.net


References: