when we need to break the comma separate string into an array in vbscript, we can call the split function in VBScript,
STKReq="110,112,113,114,115"
stockReqArray=Split(STKReq, ",")
if we have already define an array with fixed length, in case i have a array which has size 10. but we did not the numbers in the string. we can first split the numbers into an number array, then use ReDim Preserve to dynamically increase the existing array and preserve all existing value by coping them to the new array.
"The first ReDim creates a new array which replaces the existing array in variable intArray. ReDim
copies all the elements from the existing array into the new array. It
also adds 10 more columns to the end of every row in every layer and
initializes the elements in these new columns to 0 (the default value of
Integer, which is the element type of the array)."
you can get more detail information from this MSDN link
ReDim Statement (Visual Basic)
the snippet code demonstrates the new array had been created and copied the exciting the value to the new array, then initialize the newly added elements with blank value, since they are null by default.
ReDim Preserve stockReqArray(10)
for i=stockReqArraySize to 10
stockReqArray(i)=""
next
a blog to share Microsoft technologies Azure, DotNet, SharePoint, SQL Server,JavaScript Framework: Node.JS, Angular, React
Showing posts with label VBScript. Show all posts
Showing posts with label VBScript. Show all posts
Thursday, April 9, 2015
Wednesday, January 14, 2015
How to fix SQL query exceeds specified time limit or storage limit against AS400 Data Source
I implmented an data loading with VB script that executing in the Look Server, I have the following connection string to access the data source.
VarConString = "DRIVER=Client Access ODBC Driver (32-bit); UID=as400User;PWD=mypassword;SYSTEM=MyDataBaseName"
But I got a very weird error on the execution. the error message is shown below
Microsoft OLE DB Provider for ODBC
Drivers
[IBM][System i Access ODBC Driver][DB2
for i5/OS]SQL0666 - SQL query exceeds specified time limit or storage limit.
the google search suggest the fix is to modify the ODBC configuraton to increase the execution time limit and storage limit.
However it is a better approach to use a different data driver. such as the IBM iSeries driver to solve those issue.
i simply replace the connection string with the following connection string, the the error is gone and data return from the execution.
VarConString = "Provider=IBMDA400; User Id=as400User;Password=mypassword;Data source=MyDataBaseName"
Thursday, September 11, 2014
how to simulate a page down key press in VBScript on Look Server
according to Microsoft TechNet Wiki
http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
Page Down {PGDN}
However in Look Server
we must use this line to advance the page down
system.SendKeys "", "{Page Down}", 1
this syntax is not available in Look Server soarchitect Help file.. i hope this post can help you reduce the time on searching
Update : we can find all the key press that supported in the Look server by search the sendkeys action

http://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
Page Down {PGDN}
WshShell.SendKeys "{PGDN}" However in Look Server
we must use this line to advance the page down
system.SendKeys "", "{Page Down}", 1
Update : we can find all the key press that supported in the Look server by search the sendkeys action
Subscribe to:
Posts (Atom)