KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using commands OBJECT SET TITLE with LISTBOX INSERT COLUMN
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: June 27, 2013

When using the command LISTBOX INSERT COLUMN, the List Box will not have a title of the inserted column. To insert a title for the header, use the command OBJECT SET TITLE. When using the two commands together, the object parameter in OBJECT SET TITLE will use the same object name set in the LISTBOX INSERT COLUMN command.

Here is an example code snippet hard coding the title "Testing Header Name":

ARRAY BOOLEAN(List Box;0)
ARRAY TEXT(myArray_at;4)
myArray_at{1}:="Row1"
myArray_at{2}:="Row2"
myArray_at{3}:="Row3"
myArray_at{4}:="Row4"

C_LONGINT($last_l)
C_TEXT($header_title_t)
C_TEXT($header_var_t)
$header_title_t:="Testing Header Name"

$last_l:=LISTBOX Get number of columns(*;"List Box")+1
LISTBOX INSERT COLUMN(*;"List Box";$last_l;"Column1";\
  myArray_at;"obj_header_title";$header_var_t)
OBJECT SET TITLE(*;"obj_header_title";$header_title_t)


Using the above code snippet, the List Box will show the header title as "Testing Header Name".