Thanks much Jeff for letting me know about this; I'll fix up the examples
and ask Aaron to post a modified version.
 
You're right; I forgot VBScript doesn't let you use a dim command with a
variable as the number of elements.  It does however let you use a "redim"
command, so you can just change the line to the one below:
 
      redim aFruits(oLstBox.count)

And this should allow the program to function as hoped!
 
Redim is meant to allow you to change the size of an array after it's been
declared (and so, that's why it's re-dim); however, if they can allow you to
use a variable here, I don't know why we couldn't in the original "dim"
statement!
 
I'll copy the scripting list on this so those following this class can see
the correction.
 
thanks.
 
Chip
 
 

  _____  

From: Jeff Weiss [mailto:[email protected]] 
Sent: Friday, October 21, 2011 2:07 PM
To: Chip Orange
Subject: fruit basket program



I was glad to see the way you enabled and disabled the controls-I hadn't
done that before.

 

I am having trouble getting this script to make and use the .ini file.

Specifically, I get errors saying that we can't use a variable in a dim
statement, but a constant is expected. This line generates an error:

 

dim aFruits(oLstBox.count)

 

The rest of the script seems to be fine, but it crashes when I press OK.

 

Jeff Weiss, CVRT

Rehabilitation Teacher

World Services for the Blind

2811 Fair Park Blvd.

Little Rock, AR 72204

 

http://www.lwsb.org

 

The Mission of WSB is to educate adults who are blind or visually impaired
for careers and independent lives.

 

Reply via email to