Example how I can the states with an if or select case structure

Started by Stephane Fonteyne, December 06, 2009, 02:29:07 PM

Previous topic - Next topic

Stephane Fonteyne

Dear all,

I would like to test the state of an option button
if the button is pressed then fired an event and call an event handler.
I don't know how I can handled this in code

I design 4 options in my TDA7300 project. If the user clicked on "Stereo 1" then send the code 0x41 via serial communication to the microcontroller that is what I like.

I try this but doesn't work

If(FF_Control_GetOption(HWND_FORM1_CHECK1) == 1) Then
    'Call the function to send to code to the PIC18F2550 via RS232
End If

Can somebody help me how I can do this in FF3

Thanks
Stephane
Stephane Fonteyne
Ba. Elektronica - ICT
GSM : +32-xxxxxxxxxx
PowerBasic Developer & Hardware Support

Paul Squires

Are you using option buttons or are you using checkboxes? Your use of HWND_FORM1_CHECK1 implies that you are using CheckBoxes.

If you are using CheckBoxes then....

Quote
I try this but doesn't work

If(FF_Control_GetOption(HWND_FORM1_CHECK1) == 1) Then
    'Call the function to send to code to the PIC18F2550 via RS232
End If

Try using FF_Control_GetCheck rather than FF_Control_GetOption.

Also, don't use "==", just use one "=".
Paul Squires
PlanetSquires Software

John Montenigro

Quote == 1)

Maybe you're using incorrect syntax?

I check many option buttons like this:

   If FF_Control_GetOption (HWND_FRMMAIN_OPTSUNDAY)    Then DOW = 6


No problem when done like this...