Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display all usernames from cursor into a message box
Message
De
30/05/2003 16:39:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
30/05/2003 16:31:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00794749
Message ID:
00794758
Vues:
10
>Could you please tell me how i can show all the usernames from the cursor into a message box with a comma delimit.
>
>**********
>select username from user where logged = 1 into cursor userlist
>
>
>=messagebox(userlist)

You have to create a string. One way to do this is:
select username from user where logged = 1 into cursor userlist nofilter
local lcUserList
lcUserList = ""
scan
  lcUserList = lcUserList + UserName;
    + iif(recno() < reccount(), ", ", "")
endscan
messagebox(userlist)
Notes:

  • NOFILTER will make sure the records are copied into a separate cursor. This is required for the recno() < reccount() comparison.
  • The equal sign isn't required at the beginning of most commands.
  • I am assuming VFP 6 or later.

    HTH,

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform