Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display all usernames from cursor into a message box
Message
From
30/05/2003 16:39:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
30/05/2003 16:31:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00794749
Message ID:
00794758
Views:
11
>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)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform