Hey George,

I think I might have just found the issue.  Being the inital dim is setting an 
array of fixed size, the redim apparently can't resize that.  If I initialize 
the variable as a non-array, then the redims work fine and can happen as many 
times as needed.

Shaun

--- In nsbasic...@yahoogroups.com, "George Henne" <g...@...> wrote:
>
> You might try testing this with a simpler program to see what is going
> on. You should also try Execute and ExecuteGlobal, which have different
> (and poorly documented) scoping rules.
> 
> >Hi All,
> >
> >I'm creating arrays based on my form names on the fly using NSExecute. 
> >Form names are read from a text file, so they're not known until run-
> >time.  For example, I have form named "Provenience" so I create a array
> >to store that data named Provenience.  The size of the array is based on
> >the number of controls that save data to files.  So if there are 4
> >controls on the form, the code that does this is:
> >
> >NSExecute "dim " & CurrentForm & "(" & UBound(ControlsToWrite) & ")"
> >
> >where CurrentForm = "Provenience" and ControlsToWrite is an array of 4
> >control names (Ubound returning 3).
> >
> >This works great with no errors.  The problem is in certain cases, I
> >need to expand this array to hold data not stored in a control (it's
> >being tracked internal to the app).  I have used NSExecute with "Redim
> >preserve" before (including in this app), but for some reason it does
> >not want to cooperate in this specific case:
> >
> >NSExecute "Redim preserve " & CurrentForm & "(" & UBound(ControlsToWrite)
> >+1 & ")"
> >
> >I've tried even hardcoding this with no luck:
> >
> >Redim preserve Provenience(5)
> >
> >No matter which way I try, I get a VBScript failure - line x, char 6
> >(just past Redim?) with no other information.
> >
> >Any ideas?  I'm totally stuck as to why this won't allow me to do it.
> >
> >Thanks,
> >Shaun
> >
> >
> >
> >------------------------------------
> >
> >Yahoo! Groups Links
> >
> >
> >
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to