ccroft Posted October 25, 2009 Share Posted October 25, 2009 Hi Ray, Thanks for sharing your considerable knowledge of Last and LastNew objects. LObject in particulas has always been a bit of a mystery whenever I've tried it. Very tricky indeed! You must've spent a bit of time testing those. Quote Link to comment
Miguel Barrera Posted October 27, 2009 Share Posted October 27, 2009 I ran the script, but VW didn't crash. But ProcessSym will only be activated once because symbols must have a unique name. No, only symbol definitions must have a unique name but you can have as many symbol "instances" in the document which is what the criteria is looking for. It would prove my finding that the script cannot reallocate and will stop at the second iteration if you indeed tested it with several symbol "instances". Quote Link to comment
ccroft Posted October 28, 2009 Share Posted October 28, 2009 According to vScript Language guide you 'should' be able to re-allocate: "Once all the objects have been processed, the array can be redimensioned to allocate more or less space as needed. In the example, additional storage space is reserved with another call to ALLOCATE, ..... Note that the existing data values stored in the array are preserved when the array is re-dimensioned. If an array is redimensioned to a larger size during execution of the script, VectorScript will preserve all the values currently in the array. VectorScript will also attempt to preserve as many data values as possible if an array is redimensioned to a smaller size. In the case of dimensioning to a smaller size, any values contained in locations beyond the newly defined boundaries of the array will be lost." But then, things don't always work like they're supposed to. I'm curious as to why you'd want to repeatedly call allocate in a loop. Maybe it's because I'm more of a static guy, but my first inclination is to run a count as a separate routine and allocate once. Strikes me a bit odd, so it seems like an opportunity to learn something. Quote Link to comment
ccroft Posted October 28, 2009 Share Posted October 28, 2009 So in an effort to learn something I went back to Language Guide and found: "It is highly recommended that you use static arrays wherever possible for the best possible script performance. If dynamic arrays are required in your scripts, avoid making frequent calls to ALLOCATE to reserve storage. Use ALLOCATE only when absolutely necessary to change reserved storage during script execution, and avoid any use of ALLOCATE inside of a loop or repetition statement (see Repetition Statements for details on these statement types)." It doesn't say it'll crash VW though. Of course...it's only a guide. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.