also Steve code compile fine
but when i run it ..then crush ...
i asking why ??
Circle (240, 240), 200, &HFFFF0000 Fill 240, 240, &HFFFF0000
i changed kolor var to _offset and then program started but then crush
The crash you're seeing is what happens if you try to do too much recursion -- you run out of stack space and crash. Change the CIRCLE radius from 200 to something like 50 and then try it and the code will run fine.
Different computers and different OSes have different amounts of stack space associated with them. MODERN Windows defaults to only 1MB, while Linux is 8MB, if my memory is right, but older versions had lower limits and those values can be altered in different manners on different OSes and compilers...
Which leads to a serious limit and issue with recursion -- how much is too much? How many times can a routine call itself before crashing?
That's hard to say. Just because it works on YOUR system, it doesn't mean it will on somebody else's. Limit recursive functions to small calls and be careful not to run out of the limited stack space you have. As you're experiencing yourself, the crashes in Windows come with no warning and no diagnostic message. Just POOF!! Program closed!!
Everyone who codes always seems obsessed with the idea of recursive code, because of its simplicity (doesn't get much simpler than the fill routine above) -- but they also need to be aware of the serious limits which comes with such style coding.
Honestly, in most cases, I'd personally try NOT to use recursion in my code, if I can avoid it. However, there's times where its ease of implementation and limited use capacity aren't a big deal, and I'll toss it in something just to get it done and over with quickly. In my mind, recursive routines go into the same category as BubbleSorts and GOTO statements -- generally best to avoid like the plague, but secretly used anyway in private when being lazy.
Just be aware of the limits when writing any type os sub/function/gosub that might end up calling itself repeatedly.