Re: TIB: 92+ Test var size


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

Re: TIB: 92+ Test var size




In a message dated 12/3/98 2:13:19 AM Eastern Standard Time, thouse@tk7.net
writes:

> >ASM can test the size of the variable, otherwise, you can manually test
>  >variable size by formulas.  For example, Strings are consisted of the
>  length
>  >of the string plus 5, expressions change from 4 bytes for 0, 5 bytes for 1
>  to
>  >255, 6 bytes for 256 to 65536, etc.
>  
>  
>  Unfortunately, I don't know asm for the 92+.  I'm too busy learning Visual
>  Basic and C/C++ to worry about a programming language for a calculator,
too.
>  I don't even know asm for pcs.  If you or somebody else could whip up an
asm
>  program that doesn't require a shell or kernel (like PlusShell or DoorsOS)
>  to test the size in bytes of _any_ variable (mainly pics) or a program that
>  actually gives the dimensions of a pic variable, I would be grateful.
Could
>  this be done using exec()?  (i realize this is more asm than basic, but im
>  not subscribed to the asm list (because i don't know asm) If someone could
>  forward this and get back to me...)

l know how to do this.
first, use the getConfg() command (l think it's that one).  one of the
elements in the returning list gives you the free RAM (let's assume it's 22,
which l think is right).  So if you wanted to check the size of string s:
"s"->a
getConfg()[22]->b
CopyVar #a,c
getConfg()[22]->c
Disp "Size of "&a&"is: "&string(b-c)