Omnimaga > BatLib

BatLib Ideas/Wishlist

<< < (20/20)

Xeda112358:
Scout, one of the main selling points of BatLib is that it technically works with all variable types. Some types like lists and real numbers you will need to know the structure, but if a command asks for a var name, it can use any variable type.

For example, if I want to read 67 bytes of Pic7 from archive at an offset of 13:

--- Code: ---dim(11,13,".Pic7",67
--- End code ---
That will return the data as a string in Ans. For an appvar, use a prefix byte of either U or 5. So for example:

--- Code: ---dim(54,63,2,"5MEOW
--- End code ---
That will read the second line in the appvar MEOW

Enjoy! :)

Munchor:
Ooh sweet, nice!

mrmprog:
I would kinda like more data structures and a randint( for recode

Xeda112358:
For now, a method for randInt( in ReCode would be to use the fact that division stores the remainder in Ans'. Using Ans in your code will swap Ans with Ans' so what you can do for randInt(1,8 is:

--- Code: ---rand/8       ;This will store a remainder of 0 to 7 in Ans'
Ans+1        ;This will swap out Ans' with Ans, then add 1

--- End code ---
I hope this helps, but if I get time to program, I will try to add in a randInt( command :)

Navigation

[0] Message Index

[*] Previous page

Go to full version