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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with NewObject()

Status
Not open for further replies.

FoxLearner

Programmer
Aug 29, 2002
93
US
Hi All

While trying to execute a NewObject, I am getting an error message "Function Name is missing)". The code is like this.

lcObject = [oCMMRate]
lcObjRef = [CMMRate]
lcObjPath = [c:\newproj\CMMRate\CMMRate]
lcObject = NEWOBJECT(&lcObjRef, &lcobjPath)

When I used hardcode
oCMMRate = NEWOBJECT("CMMRate","c:\newproj\CMMRate\CMMRate")
it is working fine.

Actually I am using it in a FOR loop, where I want to get the names of Tables from an Array and Create dataObjects.

Can you please tell me where I am wrong?

Thanks and Regards
FoxLearner
 
FoxLearner,
If you look at your code, you'll see the answer, if you understand that a macro (&) requires a string. Basically you are missing the quotes! Try:
Code:
lcObject = [oCMMRate]
lcObjRef = [CMMRate]
lcObjPath = [c:\newproj\CMMRate\CMMRate]
&lcObject = NEWOBJECT("&lcObjRef", "&lcobjPath")
* this will "expand" to
* oCMMRate = NEWOBJECT("CMMRate", "c:\newproj\CMMRate\CMMRate")
Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top