Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Array Help Needed
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

cbovis
New Member

United Kingdom
91 Posts

Posted - 24 August 2001 :  12:13:10  Show Profile
Have this

Dim Pages(RsStatusCount("RecNum"))

but get error:

Expected integer constant

/nxforever/inc_top.asp, line 60

Dim Pages(RsStatusCount("RecNum"))

When printed RsStatusCount("RecNum") is an integer!

Whats up wit dis?

Craig



I am your lord so bow down to me.

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 24 August 2001 :  13:39:45  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Try Pages(Cint(RsStatusCount("RecNum")))

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 24 August 2001 :  14:17:30  Show Profile
Don't we use Redim instead of Dim???

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 25 August 2001 :  04:42:56  Show Profile
But is it a positive integer?

If it were me, I'd copy the recordset field into a local variable first, and do some tests to make sure the data is valid (not null, >= 0, etc.)


======
Doug G
======
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 25 August 2001 :  04:45:07  Show Profile
quote:
Don't we use Redim instead of Dim???

ReDim is used to resize an existing array.

If you Dim myArray(5) you have an array with 6 elements. If you want to add a new element for a total of 7, then you ReDim myArray(6). Use ReDim Preserve to keep existing array elements intact.


======
Doug G
======
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 25 August 2001 :  18:24:26  Show Profile
Since cBovis is using variable RecNum to establish the array size, I thought, may be this is being done to redefine the array size.



Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07