Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acopy() and myArray_assign()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00887723
Message ID:
00888026
Views:
15
Hi Hugo,
You're probably right about dimension myArray(1). I did it in the class designer, so I'm not sure about the syntax in a prg.

I'm confused about why my acopy() triggers but your's doesn't. Are you using a different language version of VFP than American? I wouldn't think that would make a difference, but who knows. I seem to remember there was a service pack for VFP 7.0. Maybe you don't have the service pack installed?



>Hey Bill,
>
>Unfortunately I can not make acopy trigger the assign, so I can not help you further :(
>
>This is the code I tried:
>
>
>clear
>loMyClass=Createobject('myClass')
>loMyClass.myMethod()
>
>
>define class myClass as custom
>
>	dimension myArray(1)
>
>	procedure myArray_assign(vNewVal, m.nIndex1, m.nIndex2)
>		this.myArray[m.nIndex1, m.nIndex2] = transform(m.vNewVal)
>	endfunc
>	
>	procedure myArray_access(m.nIndex1, m.nIndex2)
>		return this.myArray[m.nIndex1, m.nIndex2]
>	endfunc
>
>	procedure myMethod()
>		local la(4, 2), i, j
>
>		for i=1 to 4
>			for j=1 to 2
>				la[i, j] = 10*i + j
>			next j
>		next i
>
>		acopy(la, this.myArray)		&& myArray_Assign not triggered
>		
>		this.myArray[1,2]=25			&& myArray_assign correctly triggered
>		
>		for i=1 to 4
>			for j=1 to 2
>				? this.myArray[i, j], Vartype(this.myArray[i, j])
>			next j
>		next i
>		
>	endfunc
>enddefine
>
>
>By the way, if I do not do the
>
dimension myArray(1)
>and put your code instead
>
myArray(1,1) = ''
>
>I got an error in the acopy saying that this.myArray is not an array....
>
>Hugo
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform