Dec 2, 2018 #1 a1sifat Programmer Joined Aug 22, 2018 Messages 11 Location BD How do i use array value as a label caption? TIA Code: thisform.label3.Caption= MyArray(2)
Dec 2, 2018 #2 GriffMG Programmer Joined Mar 4, 2002 Messages 6,345 Location FR 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. Upvote 0 Downvote
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.
Dec 2, 2018 #3 Mike Lewis Programmer Joined Jan 10, 2003 Messages 17,516 Location Scotland 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 Upvote 0 Downvote
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