Re: The best way to keep data in RAM / object-oriented programming [message #68948 is a reply to message #68774] |
Mon, 07 December 2009 09:42  |
Juggernaut
Messages: 83 Registered: June 2008
|
Member |
|
|
On Dec 4, 3:25 pm, nata <bernat.puigdomen...@gmail.com> wrote:
> First of all, I suppose that for use the ASSOC function I need to
> store my arrays into a binary file. That's not very efficient...
> After that, I tried to accede to the created files to get the desired
> information and I didn't succeed. Maybe I don't know how to use this
> function properly but I always have errors.
> I don't know if I can use the ASSOC function in order to save
> compressed data using the PACKED keyword and then have access to the
> file efficiently. If it's possible and this is a good solution to keep
> information, please tell me how to do that.
; Create a blank file ready to receive data
data = FLTARR(256,256)
OPENW, lun, writename, /GET_LUN
FOR i = 0, 99 DO WRITEU, lun, data
FREE_LUN, lun
OPENU, datalun, writename, /GET_LUN
A = ASSOC(dataLun, data)
; Perform some genius processing of your choosing
FOR i = 0, 99 DO BEGIN
newFrame = FLTARR(256,256) + i
A[i] = newFrame
ENDFOR
I believe this is the general way I did things.
|
|
|