|
> I have used code posted recently that showed how to get the name of the > attached journal receiver, (I forget who posted it, beg forgivness). Hmmm... some of the coding style looks like Carsten Flensburg (I read a lot of his code for some reason) other parts of it don't look familiar -- I assume that that's your part of it. [SNIP] > In the archives I note Carsten Flensburg and others mention pointer > handles. Not sure what you mean by "handles" but yes, a little bit of pointer logic would certainly solve your problem. > Can I use pointers to get back more than 64K bytes of data in case I have > more than 512 associated receivers. Well, a pointer just points to an address in RAM, it does not infer any length by itself. You can ask the system to allocate memory for you in a few different ways... The most basic way is to use the %ALLOC() BIF (or ALLOC op-code) to grab a chunk of memory from the heap -- which is limited to about 16mb of data. Much more than 64k! Other methods would be to get a pointer to a user space, which would give you a 16mb area that could be configured to automatically expand as needed. Or to use teraspace, which would give you the ability to address gigabytes of memory at once -- if you really need to go that high ;) > Can I get the API to populate a User Space or a MODS. > I have used User Spaces previously but those APIs directly populated. > I have searched the archives but I am too thick to get it, any help is > muchly appreciated. It's too late and I'm too tired to code a complete example of this. Try taking the following steps: 1) Call the API with a very small data structure that contains only two fields, the "bytes provided" and "bytes available" fields. The API will put the number of bytes of memory that it needs into the "bytes available" field -- you can use this to create a data area or memory allocation of the appropriate size. 2) Create a user space, or allocate memory. In either case, you'll want to get a pointer to that memory. 3) Base a variable on the pointer from step 2. 4) Call the API again, this time pass the variable from step 3 as the receiver variable to the API. The API will load up the memory that the variable is in -- and since the variable is based on the pointer, that area of memory will be the area that the user space or ALLOC-ed memory resides in. 5) Access the memory as needed with a pointer. 6) When you're done, either deallocate the memory with the DEALLOC op-code or delete the user space. Hope that helps...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.