mikelcid
New Member
Hi all again!
I have a problem with the extent of an array.
I have two combo-box, the first one the names of tables from a DB and when the user select one of these tables I fill-in the other combo-box with the fields from the table selected.
That works fine but if the user change his mind and select another table from the first combo-box it throws an error saying that the extent of the array added to the second combo-box is assigned and it can't be changed but I need to do that so I can fill that combo-box with the fields from the new table.
Any idea of how to change the extent of the array assigned to the second combo-box?
This is the code in the SelectedIndexChange from the first combo-box:
As always I am using OpenEdge 10.2B.
THX!
I have a problem with the extent of an array.
I have two combo-box, the first one the names of tables from a DB and when the user select one of these tables I fill-in the other combo-box with the fields from the table selected.
That works fine but if the user change his mind and select another table from the first combo-box it throws an error saying that the extent of the array added to the second combo-box is assigned and it can't be changed but I need to do that so I can fill that combo-box with the fields from the new table.
Any idea of how to change the extent of the array assigned to the second combo-box?
This is the code in the SelectedIndexChange from the first combo-box:
Code:
THIS-OBJECT:comboBox3:FormattingEnabled = TRUE.
@VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
tabla = comboBox1:SelectedItem.
i = 0.
FOR EACH _file WHERE _file._file-name = tabla NO-LOCK:
FOR EACH _field WHERE _Field._File-recid = recid(_File) NO-LOCK:
i = i + 1.
END.
END.
ASSIGN EXTENT(arrayvar1) = i.
i = 1.
FOR EACH _file WHERE _file._file-name = tabla NO-LOCK:
FOR EACH _field WHERE _Field._File-recid = recid(_File) NO-LOCK:
arrayvar1[i] = _field._field-name.
i = i + 1.
END.
END.
THIS-OBJECT:comboBox3:Items:Clear().
THIS-OBJECT:comboBox3:Items:AddRange(arrayvar1).
As always I am using OpenEdge 10.2B.
THX!