Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create checkbox to exclude some code
#1
Hi there!

Is it possible to let te macro check wether a checkbox is checked or not and if it's check to exclude a part of the code?

I have no clue how to implement this in a macro i use, i don't know how to check if a box is checked or not ( helpfile is not clear for me) and if so how can i exclude some part of the code.

If there is anybode who can give me some tips/workouts or even a sample i will he helped very much....

THX
#2
When you click Apply in the dialog editor, it inserts variables for some controls, including checkboxes. Variable name is displayed in the dialog editor, below the list, and looks like c3Che. In code, after ShowDialog, insert code like this:

if c3Che=1
,code to be executed if checked
else
,code to be executed if unchecked
#3
Ok i tried this but it didn't work i'll give the situation to explain and maybey i'm missing someting:

I have a dialog, in this dialog there is a checkbox, if it's checked it has to exclude some code. The action depends on what is selected in a listbox. The listbox-action jumps to a certain part of code like this:

this part
is c3Che = 1
,mes "checkbox checked"
else
, mes "checkox unchecked"

No action (message) is given, the output field gives only counting numbers?

Any ideas what i'm doing wrong?
#4
Hi i'm not sure if u just did a typo here or its wrong in ya code but you have is c3Che = 1 instead of if c3Che = 1
#5
Sorry,

That's a typo, all functions etc are ok but no actions are performed, so i have to do something wrong i think....
#6
Hi there again,

I played sometime and think i found my solution i changed the above code with:

if (but(id(8 hDlg)))= 1
mes "Checked"
else if (but(id(8 hDlg)))=0
mes "Not checked"

The button code 3/8 was only for posting purposes and was adapted but the first version didn't work!

I hope somebody else can benefit from this.....

THX you all for your help...
#7
I thought you need to get checkbox state after the dialog is closed. If in dialog procedure, your code is OK. It can be simplified:

if but(8 hDlg)
,mes "Checked"
else
,mes "Not checked"
#8
Ok thx for your supplement, i will remeber that.


Forum Jump:


Users browsing this thread: 1 Guest(s)