15!:6 give the pointer to J array, the pointer to the actual data can be found depending on you want a boxed address or not.
NB. ========================================================= NB. (iad) integer address - returns pointer to a J array NB. NB. monad: iaAdd =. iadd clNoun NB. NB. boo =. 'some data here ehhh!' NB. iad 'boo' iad=: 3 : 0 ple=. 15!:6 <y NB. pointer to local entry pa=. memr ple,SZI,1 4 NB. ptr to array ''$pa+memr pa,0 1 4 NB. plus offset to data ) NB. ========================================================= vad=: <@:iad NB. boxed address These two verbs come from odbc.ijs. They were there for at least 10 to 15 years I supposed, but never documentated in official helps. Пнд, 18 Окт 2010, Henry Rich писал(а): > Interesting. I looked in jmf, and I tried > > 15!:7 verb > > which crashed J. > > I can't see which of these tells me the address of the data for a noun. > Can you help? > > I can't make any sense of the description of 15!:6 so I didn't try it. > > Henry Rich > > On 10/18/2010 11:03 PM, bill lam wrote: > > Try these foreigns. > > > > symget=: 15!:6 NB. get address of locale entry for name > > symset=: 15!:7 NB. set name to address header > > > > examples are provided inside jmf script. > > > > Пнд, 18 Окт 2010, Henry Rich писал(а): > >> All of a sudden I have to interface to a DLL that takes a big buffer as > >> input and produces a big buffer as output. > >> > >> The input I have, in the variable xxx, but the DLL requires that I > >> create a structure that points to the input. > >> > >> I would like to stuff the address of the data (which is read-only to the > >> DLL) into the structure; but I can't get that address. So I have to > >> allocate a big area whose address I know, and memw the data to it. Ecch. > >> > >> I would like a new foreign: one that returns the memory address of the > >> data of a noun (or maybe a name). > >> > >> Henry Rich > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
