Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


HTA + Array + reuse Array

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,47111
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HTA + Array + reuse Array
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 HTA + Array + reuse Array - 5/15/2007 7:34:08 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
I have an array that has been read from a text file. I've found that an array can't be reused or I just don't know how to reuse an array.
I believe it's me ;-)

The HTA has many drop down list boxes, 96 to be exact, the first selects a file to use and populates the array.
The others just need to hold the list.

name="TeamArray"

The error I get when I use the name="TeamArray" more then once is... Object doesn't support this property or method: 'TeamArray.Add'
I'm not running the script again just trying list what is in the array.

I tried running each drop down list as it's own array, it works but YUCK memory hog.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF
 
 
Post #: 1
 
 RE: HTA + Array + reuse Array - 5/15/2007 7:49:23 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Can you post what you have tried?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 2
 
 RE: HTA + Array + reuse Array - 5/15/2007 8:11:09 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
It's 223 lines... Find the line with "TeamSelect" if there is another TeamSelect it gives the error.


      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: HTA + Array + reuse Array - 5/15/2007 8:23:19 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Line 223 on my end isn't anything relating to TeamSelect.

You function ListofPlayers lists the players in the TeamSelect drop down correct?

Are you trying to get those same names to apear it the other drop down lists?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 4
 
 RE: HTA + Array + reuse Array - 5/15/2007 8:34:46 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
The Function Team is triggered by OnChange=Team" the file list of file names generated by Function Window_onload
Function Team does a Call to ListofPlayers and populates the HTML Select name="TeamArray"

If I use name="TeamArray" more then once it give the error...Object doesn't support this property or method: 'TeamArray.Add'

It's like it's trying to add to use TeamArray.Add as the name of the array.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: HTA + Array + reuse Array - 5/15/2007 9:58:43 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Each select object must have a unique name.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 6
 
 RE: HTA + Array + reuse Array - 5/16/2007 3:39:32 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
Now each Select object has a unique name.

Is it possible to load the array in to each unique name?

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 7
 
 RE: HTA + Array + reuse Array - 5/16/2007 5:34:17 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Can you post what you have now? Oh, and should all the Selects have the same info?

< Message edited by dm_4ever -- 5/16/2007 5:37:58 AM >


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 8
 
 RE: HTA + Array + reuse Array - 5/16/2007 5:48:46 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
Yes each select should have the same information the table of player name generated.
I put another dent in my desk... ;-0

Don't know why I can't see this one... All this script will do is generate where the players will play and what the batting order is.
I haven't even started the hard script for batting stats.


      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 9
 
 RE: HTA + Array + reuse Array - 5/17/2007 1:51:15 PM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
See if this works for you. It should fill in each drop down with the same values.  The way it was accomplished was by using getElementsByTagName to return a collection of all the Select objects and recurse through them adding the values to each.  You will see it used in the ListofPlayers function.

A few other changes where made such as moving your FSO constants to the top so it is only used once and replacing the paths to the folders with variables to easily update. 

P.S.  That table must be very sturdy with the many dents you seem to put into it.