[futurebasic] Re: [FB] Re: FBtoC Questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2007 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 30 Oct 2007 19:05:30 +1300
>
> Second, I can not use the objPtr.field = classRecPtr [than would be  
> easy] because my Objects are not DIM'ed as any record type and their  
> definitions are totally dynamic and occur after the MxNew FN which  
> is a Class Management FN and is available to the entire project and  
> at the top of the code. They are only blocks of memory the size of  
> Class Objects.


>
> local
> dim as mxobject @newObj
> dim as mxobjectptr @objPtr
> local fn MxNew( ClassRecPtr as ptr to MxClassDR ) as pointer

If mxobjectptr (perhaps better written as MaxObjectPtr) is a type  
equivalent to a plain pointer, then this may be what you are after:

// copy value of classRecPtr to first field (4 bytes) of newObj
mxObjectPtr.0& = classRecPtr

Robert P.