Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building object name and calling it
Message
From
04/03/2017 09:54:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/03/2017 22:05:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01648762
Message ID:
01648774
Views:
63
The reason this doesn't work is because in:
thisobject='Dayjobsline' + alltrim(str(x))
thisobject will end up just being a text string, NOT an object. If you apply eval() to it, you should get an object.

>I have a form with a number of the same invisible objects on. I want to make them incrementally visible according to how many records are in a table - 1 object for each record...
>
>This code generates a 1925 error - Unknown member "name".
>
>
>zrecs=RECCOUNT()
>IF zrecs>0
>	FOR x=1 TO zrecs
>		thisobject='Dayjobsline'+ALLTRIM(STR(x))
>		thisform.thisobject.visible=.t.
>	NEXT
>ENDIF
>
>
> I have checked the value and type of 'thisobject' by displaying it in a messagebox, and it is all correct, yet I still get the 1925 error.
>
>Please advise what I am missing here...
>
>Many thanks!!
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