0 Members and 1 Guest are viewing this topic.
The easiest way *not available until the next version* is to absorb them directly into the program.Recall that when you have a title screen that takes up the whole screen, you don't want to have to type out the entire 1536 hex characters:[123ABC...]Instead, you can absorb an OS picture into the program simply by doing this:[Pic1]The same thing applies for tokens. If you want a string of tokens, then instead of doing:Data(t1,t2,t3,tA,tB,tC,...)You can do any of these:[Ans][Str1][prgmABC][appvABC]And the data will be directly absorbed into the program, depending on where you have your tokens stored (The one with Ans is kinda volatile, I wouldn't recommend that). To find the length of some data of unknown size, you can't use length() because its not necessarily zero terminated, and you shouldn't use it anyway since its a slow routine and you already know the pointers are static. Instead you can just subtract the start from the end of the data pointer.:[Str1]->Str1:[]->Str1E:Copy(Str1,L1,Str1E-Str1)
Yeah, something like that. But I'm really only talking about for a 'public' release. The odds of having less than 15ish bytes left on your calculator is probably very rare. Any triple digit of bytes is rare for me at least. If you're just doing this to quickly test out the features or to generate a file like from a map editor then you really don't need the error checking since you're aware of the problem and know how to avoid it. Its only if other people use your program that you would want to check for errors.