Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array value as label caption

Status
Not open for further replies.

a1sifat

Programmer
Aug 22, 2018
11
BD
How do i use array value as a label caption? TIA

Code:
thisform.label3.Caption= MyArray(2)
 
So long as your array element contains a string, that code should work.
If you aren't sure of the element type, use TRANSFORM() to force the issue.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
So, so does your code work? Are you seeing an error message? If so, what is it?

The only reason I can think for it not to work (apart from Griff's point) is if the array has gone out of scope, or if it has fewer than two elements.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top