baseConvert() & 32-bit ops
Dar Scott
dsc at swcp.com
Sat Jun 21 23:47:01 EDT 2003
On Saturday, June 21, 2003, at 10:11 PM, Mark Brownell wrote:
> This is fast and easy. I've never seen a function like this where the
> parameter seemed empty and it worked that way.
Yes, normally we think of commands as the operations _on_ variables.
Yet, there are a few functions with side effects, such as matchText().
You can build your own commands and functions that work this way by
using reference parameters (see @ in the Transcript Dictionary). For
example, you can code a swap command as a handler with two reference
parameters.
> I like the way it returns 1 for error testing.
This is the number of variables converted. You are using a trivial
case of only trying to convert one. Success is typically when the
number attempted is the number converted. In this case, 1.
> put 1 into i
> repeat while i <= 32
...
> put i + 4 into i
> end repeat
From the TD, it looks like this should work, too:
repeat with i = 1 to 29 step 4 -- last halfBlock is of 'char 29 to 32'
...
end repeat
I'm glad this is working well.
Dar Scott
More information about the use-livecode
mailing list