Log In
Sign Up and Get Started Blogging!
JoeUser is completely free to use! By Signing Up on JoeUser, you can create your own blog and participate on the blogs of others!
eyeJ
Help with arrays in VBS
Why can't I resize an array more than one time?
Published on March 15, 2006 By
eyeJ
In
Scripts
I have windows script host version 5.6.8820
I have DesktopX 3.1 full (not pro not public ... cant remember how u spell it hehe)
The thing i need to do is make an Array to contain some data but the array must be accessable from and function or sub within the objects code.
so here's a short script wich causes the folowing error:
Subscript out of range
Line: 17
Code:
(not available)
Dim
)
Dim y
'Called when the script is executed
Sub Object_OnScriptEnter
y = -1
y = y + 1
End Sub
Function Rescale(Enabled)
If Enabled = True Then
ReDim Preserve
y, 5)
ReDim Preserve
y, 5)
0, 0) = 1
y = y + 1
ReDim Preserve
y, 5)
y = y + 1
ReDim Preserve
y, 5)
Do While y < 10
y = y + 1
ReDim Preserve
y, 5)
Loop
End If
MsgBox "Done"
End Function
Sub Object_OnLButtonUp(x, y, Dragged)
If Dragged = False Then
Rescale True
End If
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub
It is werry important for my widget to use arrays and there is no other way i can do the thing i want.
This is a bit trivial code but it is enough to produce an error. The documentation of windows script host doesn't say anything about this problem.
Do I need the latest version?
I have WinXP SP1 and SP2 by the way.
Thank you for help in advance!
Article Tags
scripts
Popular Articles in this Category
Creating reusable scripted components for DesktopX - Part 3
Popular Articles from eyeJ
Comments
No one has commented on this article. Be the first!
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
Richer content, access to many features that are disabled for guests like commenting on the forums.
Access to a great community, with a massive database of many, many areas of interest.
Access to contests & subscription offers like exclusive emails.
It's simple, and FREE!
Sign Up Now!
Meta
Views
» 4552
Comments
»
0
Category
»
Scripts
Comment
Recent Article Comments
Modding Ara: History Untold
LightStar Design Windowblind...
DeskScapes 11: The Dream Mak...
Which A.I. Software Are You ...
ChatGPT 4o vs. o1 vs. o1 Pro...
What's the Last Book You Rea...
A day in the Life of Odditie...
Let's start a New Jammin Thr...
Let's see your political mem...
Safe and free software downl...
Sponsored Links