QDerive QUEUE(MyClassQType)
END
QRef &MyClassQType
CODE
QDerive.Field1 = 42; ADD(QDerive)
QRef &= NEW MyCassQType
QRef.Field1 = 142; ADD(QRef)
! at clean up...
DISPOSE(QRef)
See ctAllTests.inc and .clw, for examples of how I like to declare typed queues in classes.
Notice how I create a GROUP,TYPE then declare the queue based on the group, type
this allows me to write methods that pass just the queue buffer as a group, vs. passing the whole queue.
Also notice my ctQueue class which I find really simplifies working with queues in classes.
My problem is I have the class declared in the global embeds so its got global scope of the app, and I thought I could use the Q type declared in the inc in the app, to create a procedure Q using the Q type from the class.
If you app is setup as a single EXE it’s very easy.
If it’s multi DLL, it’s still easy just more steps involved.
Just declare your CLASS in the GLOBAL data section of the EXE, or, if MULTI DLL in your “Data.DLL” like:
SomeName Class(YourClass)
END
Multi-DLL
In an app where you want to use your Global CLASS, in the Global Data section:
SomeName Class(YourClass),External,DLL(dll_mode)
End
Assuming your INC file is setup something like:
SomeQueueType Queue,Type
SomeVarOne String(10)
End
YourClass Class,TYPE,MODULE('YourClass.clw'),Link('YourClass.clw',_ABCLinkMode_),DLL(_ABCDllMode_)
YourQ &SomeQueueType
End
I was using Add(YourClass.YourQ) in the app procedure when all I needed was Add(YourQ) because it was Typed in the .inc file but outside of the YourClass,Type.
So just like equates declared in the .inc file but not inside the class type can conflict with equates in the app, its the same thing, the queue declared in the inc as a YourQ,Type but not declared inside the Class,Type doesnt need the YourClass if using it in an app procedure.
Well I’m wondering about the copy of the OS or version of Clarion I have here, because yesterday, when using the directory function, I could only get directoryq.name = ‘…’ to work with clip(directoryq.name) = ‘…’.
The … being the . and … that is left over from the old dos days seen in sub directory listing.
I’m beginning to think I’ve special edition or limited edition OS or version of Clarion!