How to represent NULL in a checkbox - Clarion 10

Checkbox represents a 1 as true and 0 as false. Is there any support for displaying NULL? In c# it has an indeterminate state:
image
Using Clarion 10
Thanks

OK, I RTFM. there is a checkbox property called STATE3. (in the help)However, not supported in the IDE. There’s also the question of how to suppress the MSSQL’s conversion of NULL to zero. And how to use it. Anybody?

STATE3 is not currently supported by anyscreen either. It will mess up your entire window.

1 Like

Thanks Jeff. Maybe I can use a textbox to represent that state? For example null=empty; 1=true and 0 = false. I could do this if I could suppress the MSSQL driver’s conversion of nulls to zero upon reading the table. How is that done? I have scoured the help for this and can’t find anything.
Note that this is only for reading the data and displaying it on the screen.

VERY timely to have this pointed out.

1 Like

when I added state3 to the control, by hand, and closed the window and re-opened it, it was removed automatically. Mind you, I am in version 10 of CW.

Here’s what I posted in the NG in April. Didn’t receive a response. Not sure I’ll ever figure out how to format code in Clarionhub, but I hope you can read it. :slight_smile:

The screenshot is what the program looks like in Anyscreen. State3Bug

===================

Finally found a use for STATE3, but it’s broken in AnyScreen.

STATE3 attribute displays code on the window instead of the control.

                PROGRAM 
                MAP
                END
INCLUDE('AnyScreen.inc') 
INCLUDE('KEYCODES.CLW')

MyCheck BYTE

Window WINDOW(‘Text Update Test’),AT(,338,63),CENTER,|
GRAY,SYSTEM,FONT(‘Segoe UI’,9)
CHECK(‘check1’),AT(23,12),USE(MyCheck),STATE3(‘2’)
BUTTON(’&Close’),AT(298,50,11),USE(?CloseButton),|
STD(STD:Close)
END

CODE                    

AnyScreen:Init() 
OPEN(Window)
ACCEPT
END
AnyScreen:Kill()
1 Like

State 3 works for me in the C10.12799 IDE Properties by checking “Enabled” in “Value 3rd State” then you must enter a State 3 Value. Also entering STATE3(‘#’) in the Window… Editor is retained. if no Value is entered in the IDE or in STATE3() then it gets ignored and lost on close.

CheckState3

CHECK('Check State 3'),AT(396,91),USE(?CHECK1),STATE3('2')

1 Like

Are you sure they are actually being “converted”? Normally a null coming from the database will have a “value” of 0, but there is also a flag (which you read with Null(yourfield)) which tells you if it is null or not. That nullness, which you can think of as an additional flag attached to numeric fields is the difference between null and zero. Clarion datatypes themselves,(shorts, longs etc) don’t have a concept of nullness.