FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WB 19]Looper with Header
[WB 19]Looper with Header
Débuté par Ericus, 11 aoû. 2017 12:26 - 3 réponses
Connectez-vous…
Ericus
#1
Posté le 11 août 2017 - 12:26
Afternoon
I have a looper linked to a query.
The header is a customer code & name and the details are some documents for that customer.
I have a button in the header of the looper and when a user clicks that button I want to turn a value ON in each of the looper lines for that customer only.
Any idea how to accomplish this?
For i = 1 to loopercount will be time consuming because there are 300+ records and I only want to turn a setting on for this one customer's documents.
Thanks in advance.
Ericus Steyn
Signaler
0
0
DerekT
#2
Posté le 11 août 2017 - 14:40
You could store the query result in array and bind the looper to that
When the button is clicked you update the array and redisplay the the result FOR EACH Customer OF arrCustomers WHERE PK_Customer = "Value" // Update a flag on the record in the array END LooperDisplay(lprCustomer)
OK a bit more code is required if you need to be on same row at the end of the process but this would run very quickly.
You could even sort the array so all selected customers appear at the top etc.
Signaler
0
0
Piet van Zanten
#3
Posté le 11 août 2017 - 17:54
Hi Ericus,
I'm assuming the looper groups the customers since you have a header.
So all you have to do is a looperseek on the client id and set the value on for each line from there until you reach the next customer or the end of the looper.
n=Looperseek(ATT_ID,MyClientID) IF n>0 THEN LOOP ATT_Flag[n]=True n++ IF n>LooperCount(MyLooper) THEN BREAK IF ATT_ID[n]<>MyClientID THEN BREAK END END Kind regards,
Piet
Signaler
0
0
Ericus
#4
Posté le 17 août 2017 - 11:19
Eventually had to follow Derek's lead.
If you use looperseek and the break then the first row is not selected and sometimes quite a few rows in succession are skipped. Don't know why.
Thanks for all suggestion.
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte