Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Jahren, 9 Monaten
Letzter Beitrag:
vor 9 Jahren, 9 Monaten
Beteiligte Autoren:
Davi, Piet van Zanten, Malcolm, Malc

capture the name of the fields in a query

Startbeitrag von Davi am 06.11.2008 02:35

There is the possibility of putting the name of the field to a query or table inside a combo box? I would like to catch the name fields of food and a combo box to develop a screen filter

Thank you


Hi Davi

If you mean having a 'hidden' column in data source of a combo which contains a field name, while the displayed value is a caption,
then you can either have an extra column in the data source which is not
included in the displayed values, or if you are manually adding items to the combo list, check out gLink.

If you actually want the field names from a query to put into the combo,
check out HListItem() to get a delimited list.



von Malcolm - am 07.11.2008 22:34
It worked well with Hlistitem, meanwhile, returned several information (item name, type, size, caption) I like it to return only the Caption

I'm using as follows:

// Retrieve the items of a file found in the current analysis
ItemList is string
ItemList = HListItem(Query_test, hLstDetail)

// Adds the list of items to COMBO1
ListAdd(COMBO_Combo1, ItemList)


von Davi - am 10.11.2008 08:44
Hi Davi

You will need to do a bit of preprocessing:

lsItems is string = ""
laItems is dynamic array of 0 by 6 string
liItems is int = 0
liItem is int = 0

lsItems = HListItem(Query_test, hLstDetail)
liItems = ArrayInfo(laItems,tiNumberRows)

FOR liItem = 1 TO liItems
// hLstDetail is specified as:
// Name of Item 1 + TAB +
// Type + TAB +
// Hyper File Type + TAB +
// Size> + TAB +
// Number of Subscripts + TAB +
// Caption + CR + ...

// 6th value is caption, so...
ListAdd(COMBO_Combo1, laItems[ liItem, 6])

// should you wish to reference the item name in code,
// try adding glink with name value
// ListAdd(COMBO_Combo1, laItems[ liItem, 6] + gLink(laItems[liItem,1])




von Malc - am 10.11.2008 10:55
Hi Davi,

Just omit the hLstDetail.


von Piet van Zanten - am 11.11.2008 17:04
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.