I need to display results in a cursor, which is received by the varaible cListData. We need to display rhese results in a list objet, so we’ve chosen RowSource = “aListData” and RowSourceType = 5 because we want to display more than 255 characters. After debugging the code, we see that the aListData variable is loaded correctly with the elements, but the list object doesn’t show the text.
LPARAMETERS cListData
-
Obtenir le message à partir de SQLMessage
LOCAL cPrefix
cPrefix = SQLMessage(81664) -
Afficher le contenu de cPrefix pour débogage
MESSAGEBOX(“Prefix: ” + cPrefix) -
Créer et remplir le tableau avec les données préfixées
LOCAL aListData[1]
LOCAL nLines -
Séparer les données en éléments individuels
nLines = ALINES(aListData, cListData, “,”)
DIMENSION aListData[nLines + 1] -
Ajouter le préfixe seulement une fois au premier élément du tableau
aListData[1] = cPrefix -
Initialiser un tableau temporaire pour stocker les lignes séparées
LOCAL tempListData[1]
DIMENSION tempListData[nLines] -
Ajouter les éléments au tableau temporaire
FOR i = 1 TO nLines
tempListData[i] = ALLTRIM(aListData[i])
NEXT -
Remettre les éléments dans aListData en commençant par le deuxième indice
FOR i = 1 TO nLines
aListData[i + 1] = tempListData[i]
NEXT -
Afficher le contenu de aListData pour débogage
FOR i = 1 TO ALEN(aListData)
MESSAGEBOX(“aListData[” + TRANSFORM(i) + “]: ” + aListData[i])
NEXT -
Définir RowSourceType et RowSource pour utiliser le tableau
ThisForm.List.RowSourceType = 5 && Tableau
ThisForm.List.RowSource = “aListData” && Entre guillemets pour le nom du tableau -
Effacer le Tag du formulaire (optionnel)
ThisForm.Tag = “”
enter image description here
- Définir RowSourceType et RowSource pour utiliser le tableau
ThisForm.List.RowSourceType = 5 && Tableau
ThisForm.List.RowSource = “aListData” && Entre guillemets pour le nom du tableau
Dan Tag is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.