On Feb 28, 2006, at 2:23 PM, Joseph J. Strout wrote:

OK.  So you've created a local array, and stuffed colors into it.

Then in another method write:

Wait a second -- what you created above was a LOCAL array. It doesn't exist in any other method.

for i = 0 to ubound(colors)
    g.forecolor = colors(i)  // crashes here

What sort of crash, exactly? Frankly I'm surprised it compiles at all -- you must have some other identifier called "colors" that's not the same as what you showed above.

You certainly CAN store colors in an array, but of course if you want it to be used in more than one method, then you want to use a property, not a local variable.


Sorry for not clarifying. The array is returned from the function which creates it to a method that defines the local variable colors().

For example:

dim colors(-1) as color
colors = getColorArray()
for i = 0 to ubound(colors)
g.forecolor = colors(i) // crashes here with debugger quitting back to the IDE
        g.drawline ...
next

Where getColorArray is:


dim c(-1) as color

c.append &c75A2DD
etc...

return c



Gary

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to