Microsoft Vbscript Compilation Error 800a0402 Expected Integer Constant
integer constant /ticketsplus/newevents.asp, line 21 Dim events(intRecCount) My code is: RecCount=rsEventList.recordcount intRecCount=cint(reccount) response.write(intreccount & typename(intreccount)) Dim events(intRecCount) Dim category(intRecCount) Adding code to display typename gives: Does VBScript not allow a variable to be used when dimensioning an array?? Thanks, Sean Mon, 21 Oct 2002 03:00:00 GMT Sean#2 / 6 Expected integer constant Whoops, sent early by accident! Missed the line below this: Quote:> Adding code to display typename gives: 76 Integer Quote: > I am receiving the following error: > Microsoft VBScript compilation error '800a0402' > Expected integer constant > /ticketsplus/newevents.asp, line 21 > Dim events(intRecCount) > My code is: > RecCount=rsEventList.recordcount > intRecCount=cint(reccount) > response.write(intreccount & typename(intreccount)) > Dim events(intRecCount) > Dim category(intRecCount) > Adding code to display typename gives: > Does VBScript not allow a variable to be used when dimensioning an array?? > Thanks, > Sean Mon, 21 Oct 2002 03:00:00 GMT Alberto Gaon#3 / 6 Expected integer constant Isn't events a reserved word under VB and VBScript? Just guessing... Hope this helps Alberto Gaona Enovar Quote:> I am receiving the following error: > Microsoft VBScript compilation error '800a0402' > Expected integer constant > /ticketsplus/newevents.asp, line 21 > Dim events(intRecCount) > My code is: > RecCount=rsEventList.recordcount > intRecCount=cint(reccount) > response.write(intreccount & typename(intreccount)) > Dim events(intRecCount) > Dim category(intRecCount) > Adding code to display typename gives: > Does VBScript not allow a variable to be used when dimensioning an array?? > Thanks, > Sean Mon, 21 Oct 2002 03:00:00 GMT Sean#4 / 6 Expected integer constant I don't believe events is a reserved word. It does not show up in the language reference, and the script w
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Declaring an array in ASP, using VBScript Want to Advertise Here? Solved Declaring an array in ASP, using VBScript Posted on 2003-06-20 Programming 1 Verified Solution 5 Comments 2,029 Views Last Modified: 2007-12-19 I http://computer-programming-forum.com/59-vbscript/b960fd92854d2e41.htm am trying to declare an array that has a variable size. This is my code: int size ... // calculates size needed ... Dim arrOne(size) But I keep getting this error: Microsoft VBScript compilation error '800a0402' Expected integer constant Any suggestions? 0 Question by:evilsmurf2 Facebook Twitter LinkedIn Google LVL 2 Best Solution byJolhid You need to use Redim. Dim array() Redim array(intSize) Jolhid Go to Solution https://www.experts-exchange.com/questions/20655204/Declaring-an-array-in-ASP-using-VBScript.html 5 Comments LVL 44 Overall: Level 44 Programming 12 Message Expert Comment by:Arthur_Wood2003-06-20 In VBScript, you need: Dim Size ' not as int size Size = 10 ' or whatever size you actually need Dim arrOne(Size) or you could simply insert a Constant value for size: dim arrOne(10) 0 Message Author Comment by:evilsmurf22003-06-20 dim sizearr sizearr = 12 dim array1(sizearr) the same error: Microsoft VBScript compilation error '800a0402' Expected integer constant /intranet/approvedprocessesview.asp, line 40 dim array1(sizearr) -----------^ 0 Message Author Comment by:evilsmurf22003-06-20 It works if I use a constant value, but I need the size to be a variable 0 LVL 2 Overall: Level 2 Message Accepted Solution by:Jolhid2003-06-20 You need to use Redim. Dim array() Redim array(intSize) Jolhid 0 Message Author Comment by:evilsmurf22003-06-20 Thanks! 0 Write Comment First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. Comment Submit Your Comment By clicking you are agreeing to Experts Exchange's Terms of Use. Featured Post Maximize Your Threat Intelligence Reporting Promoted by Recorded Future Reporting is one of the most important and least talked about as
be a constant. For example, Copy CodeDim a(10) ' is valid. Dim a(x) ' microsoft vbscript compilation is not valid. Dim a(1=2) ' is not valid. To correct this error Use the ReDim statement. See AlsoReferenceDim StatementReDim Statement
Need Help about VBScript? Download VbsEdit! This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit.The evaluation version never expires. Home Copyright © 2001-2016 AdersoftGoogleВойтиСкрытые поляПоиск групп или сообщений