Login | |
|
 |
RE: Array not working - 10/21/2007 4:11:34 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1147
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
Post the code that you already have, so that we can see where you're going wrong, and get a better idea of how to help you.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: Array not working - 10/21/2007 4:22:27 PM
|
|
 |
|
| |
stinesondre
Posts: 2
Score: 0
Joined: 10/21/2007
Status: offline
|
Thank you for the quick reply. Here is the code where I try to read the data into the arrays : Dim objRootDSE, objConnection, objCommand, strDomain, Printers Dim objRecordSet, objPrinterSet, objComputer,oArgs, objTextFile Dim strPrinterShareName, strRoomID, strDescription, strLocation, strNextLine Dim intPrintArrStart, arrServiceList, objFSO, DisplayName, printserver Const fileRead = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile ("c:\getPrinters.txt", fileRead) Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline arrServiceList = Split(strNextLine , ";") Redim Printers(0) intPrintArrStart = Ubound(Printers) For i = 0 to Ubound(arrServiceList) 'WScript.Echo "i = "& i & " " & arrServiceList(i) strPrinterShareName = arrServiceList(0) DisplayName = arrServiceList(1) printserver = arrServiceList(2) strLocation = arrServiceList(3) strDescription = arrServiceList(4) ReDim Preserve Printers(intPrintArrStart + 5) Printers(intPrintArrStart + 0) = DisplayName ' "DisplayName" Printers(intPrintArrStart + 1) = strPrinterShareName ' "PrinterShare" Printers(intPrintArrStart + 2) = printserver ' "PrintServer" Printers(intPrintArrStart + 3) = strRoomID ' "RoomID" Printers(intPrintArrStart + 4) = strDescription ' "Comment" intPrintArrStart = intPrintArrStart + 1 Next Loop 'MsgBox IsArray(Printers) i = 0 ReDim printerArray(i) For Each tmpArr in Printers 'MsgBox printerArray(i) MsgBox tmpArr 'printerArray(i) = tmpArr i = i + 1 Next Can you guys see what I am doing wrong ? Thank you for the help..
|
|
| |
|
|
|
|
|