
-----------------------------------
Vicous
Sat May 15, 2004 2:02 pm

GUI Troubleshooting
-----------------------------------
Hmm. Well, I'm programming a calc for SimRTK if anyones ever heard of it, and I ran into a very weird error. I run the code and when I type anything in the text fields I created at the top, it brings up an error. Try it for yourself:

Breaker.FCpages.com/SimCalc.t

-----------------------------------
guruguru
Sat May 15, 2004 3:25 pm


-----------------------------------
Move your initialization of the text box after the initialization of your text fields. But more problems occur.

And wow, your programming is VERY unefficitent. For one thing, DO NOT declare all you check boxes individually. Make them an array... for example in the initialization- instead of doing what you did, try this:


var checkbox : array 1 .. 62 of int
var checkboxNames : array 1 .. 62 of string  := init("Aid", "Ambush", etc...)

for x : 0 .. 3
    for i : 1 .. 17
        exit when i + x * 17 > 62
        checkbox(i + 17 * x) := GUI.CreateCheckBox (20 + 100 * x, maxy - 175 + 25 * i, checkboxNames(i + 17 * x), BoxEntered)
    end for
end for


And voila! 124 lines into 8!!! And change everything else like youre enable and disable procs and youre program will go from 450 lines to 