It is necessary to obtain information of contents Value (not attributes (not properties)) of elements of a Control ?List which dynamically receives an infomation from a third-party class and to appropriate values to STRING variables
WINDOW WINDOW('Window'),CENTER,GRAY,IMM,SYSTEM,MAX
LIST,AT(10,100),USE(?List),VSCROLL
END
CODE
OPEN (WINDOW )
DR.Exec( InputString, ?List )
DISPLAY()
Anyway, you can’t just declare LIST as per your example. The data items displayed in the LIST come from a QUEUE or STRING specified by the FROM attribute and are formatted by the parameters specified in the FORMAT attribute (which can include colors, icons, and tree control parameters).
It might help if you told us what the DR object was.
Is it a 3rd Party Clarion add-on, if so it may expose the internal queue structure as a reference.
The PropList properties will only get parts of the listbox format string - they won’t retrieve values from the rows or columns of the list.
Clarion list controls are ‘owner drawn’ which means the normal Windows API methods of getting items from the list control won’t work.
If you have the code for the DR Class then somewhere in there will be a QUEUE (probably marked PRIVATE).
If you remove the PRIVATE attribute it will be accessible to your code - then you may be able to do something like…
You’re using a completely non-standard way of accessing a database using this free Class
which uses direct ODBC calls to the backend and and virtual listbox !
It’s best to stick to the standard Clarion way of doing things or at least use 3rd Party tools that provide support.
I can’t get that Class to work at all using SQL Server but looking at the declarations in ODBCClass.inc it seems there are four Class methods provided to access the selected row or cell in the listbox…
Fetch PROCEDURE( STRING column, STRING value ), LONG, PROC
Get PROCEDURE( STRING column ), STRING
GetCurrentRow PROCEDURE, LONG
GetCell PROCEDURE( LONG row, SHORT column ), STRING
?List{PROP:Selected} will get you the selected row and look at proplist:mousedownrow etc to get the selected cell.
Thank you for pointing me in the right direction, at least in the help files.
Is there a way to right justify a field at runtime, without affecting the entire column?
IF MyFielRight = 1
?List{PROPLIST:Right,2} = TRUE
Else
?List{PROPLIST:Left,2} = TRUE