Arrays

I am trying to get data out of an array using a client-side subroutine in a ASP page. I have tried to access the content of the array 2 different ways. The first way I defined the array with no dimensions between the script tags, which I thought meant the array was accessable by the entire page. This gives me a subscript out of range error when the subroutine is called from the onclick. I then tried defining the array with dimensions and removing the redim. When I do that I get an "op_array not defined" error when reading the data into the array.

1) vbscript, by default, ONLY runs on the SERVER, not the client. IF you want the VBScript to run on the CLient, add the paramenter RUNAT=CLIENT:

<SCRIPT LANGUAGE=vbscript RUNAT=CLient>

but you are then limiting the use of the page to IE4 or later

2)

Dim op_Array()

defines an array with no fixed dimension...before you can actually use it you MUST use the ReDim statemetn to assign the actual dimension. This will allow you to dynamically resize the array at run-time to allow it to grow as more elements are added. (With a 2-dimensioned array, you can only dynamically resize the second dimension). If you wish to keep any existing values in the array when you ReDim, use th additional keyword Preserve

dim op_array()

ReDim Preserve op_array(10) ' this will clear all exiting values, and allow you to enter 10 values into the array
.
.
.
ReDim Preserve op_array(20) ' this will keep the first 10 values, and aloow you to add 10 more (for a total of 20)

The problem here is that the array created on the server side does not exist on the client side. First the script is run on the server, then the page is sent to the browser, and the script is run on the client.

GreenGhost...is what you say about <%...%> is true, then WHY is it that ALL (every one, without exception) of my ASP pages with <%....%> embedded BSScript has that Script Executing ON THE SERVER...and only those pages that include JScript has any code that executes on the CLient, and then it is only the JavaScript that executes on the Client? AM I just lucky???

Sorry GreenGhost, but I have NEVER EVER EVER needed to explicitly specify RUNAT=SERVER for my VBScript. I guess I am just lucky that ALL ob my VBScript spontaneously "knows" that it is supposed to run on my server. How am I so lucky?

By the way, I believe that RUNAT=CLIENT WAS the default for ASP 2.0, and RUNAT=SERVER IS the default for ASP 3.0 and later

"When you write server script in an .asp file, you distinguish it from other text (including client script) in one of two ways:

Within the delimiters <% and %>. Any text between these two tags is processed as INLINE SERVER SCRIPT by IIS[My emphasis]. The <% %> delimiters are often used to enclose expressions that are evaluated and inserted into the HTML text of a page. For example, the following server script displays the current time on a page:
<% response.write time %>

In a <SCRIPT> tag (as with client scripts), but with the RUNAT=SERVER property, which is used to enclose stand-alone procedures such as functions and subroutines. The following example shows the RUNAT property:
<SCRIPT RUNAT=SERVER>
Function GetDate
[some script lines here]
End Function
</SCRIPT>

In the Visual InterDev HTML editor, server script appears in yellow to distinguish it from client script. The following illustration shows a page that includes both server script (bracketed in yellow) and HTML text."

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :)
To start, I want to make sure everyone understands the importance of utilizing p…

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference:
Let's make the introductions...
Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…

This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory.
NOTE: For Outlook 2016 and 2013 perform the exact same steps.
Open a new email: Click the New email button in Outlook.
Start typing the address: …