Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Createobject
Message
From
25/12/2002 03:19:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/12/2002 18:09:18
Victor Verheij
International Film Festival Rotterdam
Rotterdam, Netherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00735703
Message ID:
00735733
Views:
8
>Hi.
>
>I want to create a procedure that can create objects from classes like this:
>
>procedure createObject
>lparamaters lcClassName, lcObjectName
> this.oMyObject = createobject(lcClassName)
> with this.oMyObject
> .enabled = .t.
> endwith
>endproc
>
>So, I got that far (...)
>
>If lcObjectName had the value of oNewObject how do I
>replace this.oMyobject with this.oNewObject
>
>tia, and merry ... to you all!
>
>Victor

Victor,
Isn't this a duplication of createobject() or newobject(). If you could provide why you need to do it we can have better ideas. Macro substitution and eval() would work :
procedure createObject
lparamaters lcClassName, lcObjectName
  this.&lcObjectName = createobject(lcClassName)
*  this.oMyobject = this.&lcObjectName
  with evaluate('this.'+lcObjectName)
     .enabled = .t.
  endwith
endproc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform