Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Philippe Peeters wrote: > > Hi all, > > I would like to define a constant vector of 299 elements with something > like > > g=[1,2,3,...] ; 299 floats values > > during execution, IDL complains with the error message > 0.006,0.006,0.006,0.005,0.005,0.005,0.005,0.004,0.004,0.004, 0.004,$ > ^ > % Program code area full. > > The manual says that there is a limit to the number of elements in array > concatenation. It should be at least 25 but the maximum is dependent of > the .SIZE defined. I have tried to increase the code and data size with > no luck. > Eventually I have cut the initial vector into pieces like this > g=[1,2,3,...] > g=[g,4,5,6,...] > g=[g,7,5,6,...] > etc... > > This is really ugly. Is there any workaround to this stupid limit? You are not alone whith this problem. Here is the workaround! You can open a file and write strings from an idlprocedure or define by hand like: ;include batch file for program: xyz.pro g=fltarr(299) g(0)=1 g(1)=2 and so on. This file is like an idl include file and could be included by @ @ must be on the first column. That's all regards R.Bauer Institut fuer Stratosphaerische Chemie (ICG-1) Forschungszentrum Juelich email: R.Bauer@fz-juelich.de
Philippe Peeters writes: > I would like to define a constant vector of 299 elements with something > like > > g=[1,2,3,...] ; 299 floats values > > during execution, IDL complains with the error message > 0.006,0.006,0.006,0.005,0.005,0.005,0.005,0.004,0.004,0.004, 0.004,$ > ^ > % Program code area full. > > The manual says that there is a limit to the number of elements in array > concatenation. It should be at least 25 but the maximum is dependent of > the .SIZE defined. I have tried to increase the code and data size with > no luck. > Eventually I have cut the initial vector into pieces like this > g=[1,2,3,...] > g=[g,4,5,6,...] > g=[g,7,5,6,...] > etc... > > This is really ugly. Is there any workaround to this stupid limit? Upgrade to IDL 5.0. :-) Supposedly all the limits of this sort have been eliminated in the new version. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Customizable IDL Programming Courses Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com IDL 5 Reports: http://www.dfanning.com/documents/anomaly5.html
> From the email I have received so far, it appears that there is no way > to define a constant vector or array of arbitrary size like you would do > in fortran or C unless you make use of tricks like the one described > above. It is still not satisfactory. A minor point, many FORTRAN compilers have a limit on the number of continuation lines, so you have a similar problem to IDL. > Does this limitation still exist in IDL 5? (I am using IDL 4.0.1) Yes, I just tested it and I got an error if I tried to use the array concatentation operator on more than 90 array elements. ____________________________________________________________ Mark Rivers (773) 702-2279 (office) CARS (773) 702-9951 (secretary) Univ. of Chicago (773) 702-5454 (FAX) 5640 S. Ellis Ave. (708) 922-0499 (home) Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail) or: Argonne National Laboratory (630) 252-0422 (office) Building 434A (630) 252-0405 (lab) 9700 South Cass Avenue (630) 252-1713 (beamline) Argonne, IL 60439 (630) 252-0443 (FAX)
R. Bauer wrote: > > You are not alone whith this problem. > > Here is the workaround! > > You can open a file and write strings from an idlprocedure or define by > hand like: > > ;include batch file for program: xyz.pro > g=fltarr(299) > g(0)=1 > g(1)=2 > > and so on. > > This file is like an idl include file and could be included by @ > > @ must be on the first column. > From the email I have received so far, it appears that there is no way to define a constant vector or array of arbitrary size like you would do in fortran or C unless you make use of tricks like the one described above. It is still not satisfactory. Does this limitation still exist in IDL 5? (I am using IDL 4.0.1) -- Philippe Peeters ------------------------------------------------------------ -------------- Belgian Institute for Space Aeronomy | Tel : +32-2-373.03.81 Institut d'Aeronomie Spatiale de Belgique| Fax : +32-2-374.84.23 3 Avenue Circulaire | Email : Philippe.Peeters@oma.be B-1180 Brussels, Belgium |