View Full Version : calculate me.

12-22-2009, 10:23 PM
hello again everybody,:)

thank you all for the support.
i need to do this. two numbers will be taken from two integer ctl and the result of adding them to each other will be shown in the third integer controller( sort of small calculator).

thank you in advance.


12-23-2009, 12:23 AM
You know you can use maths in controls don't you?

Like typing '10+20 <return>' will give 30 in the control?

Atlernately use the ctrlrfresh (www.mikegreen.name/Lscript/Source/Control_Commands.htm#ctlrefresh) command to cause the result field to update when the inputs change.

12-23-2009, 12:45 AM
thank you dodgy.
i tried ctrlfresh but i found it very complicated to understand, the manual wouldn't help much, need more description on how to use it.

12-23-2009, 02:56 AM
counter = 2;
c1; // Need to declare this in the global scope


filenames = matchfiles("c:\\temp","*.*");
c0 = ctlchoice("Test",counter,@"X","Y","Z"@); // User selects x,y or z
c1 = ctlstring("Filenames",filenames[counter]);
ctlrefresh(c0,"refresh"); // when user chooses x/y/z, 'refresh' is called

refresh: value
setvalue(c1,filenames[value]); // this sets the filename for c1 to the first/second/third file in c:\temp

12-23-2009, 03:12 AM
still need some details about this ctlrefresh and it's use, and how to apply it in my example.

thank you.
Wael K.