I don't see anything in the code you've shown that would do this, but i% will have a value of 55 after the FOR NEXT LOOP is completed. Frankly, I've had the same situation and I chose to keep track of the Button that was Marked, then unmarking it when another one is marked. It does require the use of some sort of Static or Global VAR, but it is much faster than running through 15 Buttons every time. Plus you have a value that you may want to save for the next time the program is opened. Joe Wilkins Stewart wrote: > I am having a problem with a hidden function named FN UnmarkBtns, which > I think is the root of another problem. > Another function draws a window with 15 buttons, number 40 to 54 When > one button is clicked, the following function is called to make sure the > button is not marked. Here the two parameters are respectively 40 and > 54. > > LOCAL FN UnmarkBtns(frst%,last%) > 'TRON BREAK > DIM i% > FOR i% = frst% TO last% > BUTTON i%, _activeBtn > NEXT i% > END FN > > The system finds the function which isnt in the FN list, and stops at > TRON BREAK. Then one step further , without the little arrow moving, I > get the message Button 55 does not exist at a line number that is way > beyond the end of the program. If I continue, I get the same message > with the button number successively incremented by 1. > > This always worked in FB II, and I am wondering if I should be doing > something different now that I am in FB^3. > > Any help will be appreciated. > > Stewart > > -- > To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>