Thanks, I worked out my issue was I was passing a null pointer to the memory function and then calling my external function. The error I kept getting was a type mismatch and did not make sense to me as the docs led me to believe that the Memory steam was a declaration, not a function on an actual pointer.
It was late here and I may have misread the docs. A sample in the documentation would be great as well as adding a note to the page on using external libraries on how to Read and write to memory streams from Gambas 3. That document has other note about using Gambas 3 but does not mention that Gambas 3 can no longer use pointers to read from memory as the example shows. I only found that information while reading through the stream documentation. Thank you for your response! On Sun, Nov 20, 2011 at 6:19 AM, Jussi Lahtinen <jussi.lahti...@gmail.com>wrote: > Sorry, > hStream = Memory pPointer For Read > > Jussi > > > > On Sun, Nov 20, 2011 at 16:17, Jussi Lahtinen <jussi.lahti...@gmail.com > >wrote: > > > I don't have any simple runnable example right now, so I hope this helps: > > > > Dim pPointer As Pointer > > Dim hStream As Stream > > Dim iYourData As Integer > > Dim ii As Integer > > Dim iNumberOfDataPoints As Integer = x > > Dim itmp As Integer > > > > pPointer = Alloc(SizeOf(gb.Integer), iNumberOfDataPoints) > > > > ExternalFunction(pPointer) ''Function takes pointer for output as > > parameter. > > > > hStream = Memory pPolku For Read > > > > For ii = 1 To iNumberOfDataPoints > > itmp = Read #hStream As Integer > > iYourData.Add(itmp) > > Next > > > > Close #hStream > > > > > > Jussi > > > > > > > > > > On Sun, Nov 20, 2011 at 06:42, Randall Morgan <rmorga...@gmail.com> > wrote: > > > >> Hi All, > >> > >> Can someone give me a sample of using memory streams to read and write > >> data > >> to/from memory. > >> > >> I am needing to read data from a C structure allocated by the external > >> library (tidy) with the pointer returned to Gambas. > >> > >> I read the page on external libraries many times before learning the > >> Gambas > >> 3 does not allow the use of READ on pointers any longer. > >> This should be updated on the how to use external libraries page in the > >> section "More on Pointers" > >> > >> Still, with the given documentation for Gambas3 I am unable to get my > >> program to compile. So a sample of reading from memory using a pointer > >> would be very helpful. > >> > >> Thanks! > >> > >> -- > >> If you ask me if it can be done. The answer is YES, it can always be > done. > >> The correct questions however are... What will it cost, and how long > will > >> it take? > >> > >> > ------------------------------------------------------------------------------ > >> All the data continuously generated in your IT infrastructure > >> contains a definitive record of customers, application performance, > >> security threats, fraudulent activity, and more. Splunk takes this > >> data and makes sense of it. IT sense. And common sense. > >> http://p.sf.net/sfu/splunk-novd2d > >> _______________________________________________ > >> Gambas-user mailing list > >> Gambas-user@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/gambas-user > >> > > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- If you ask me if it can be done. The answer is YES, it can always be done. The correct questions however are... What will it cost, and how long will it take? ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user