Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Fundamental ASP question

I'm trying to understand the basics of VBscript in regards to initializing and incrementing variables. This all started while I was trying write a "multi-page" data entry form. Unfortunately, I never could increment the counter successfully.

The following code is a simplified version of this attempt (Note the hitcounter never exceeds 1):

<%
option explicit
dim hitcount
hitcount=0
if CStr(Request.Form("Submit")) <> "" then
hitcount = hitcount + 1
end if
%>



">





Is the hitcount variable re-initializing after each time the "Hit" button is clicked? I tried an alternate version of this where "option explicit; dim hitcount, hitcount=0" were removed, but it didn't make any difference. So what gives?

Comments

  • Shawn CarterShawn Carter Member Posts: 0

    || http://forcoder.org || free ebooks and video tutorials about ( R MATLAB Go Scratch Java Python Objective-C C# Visual Basic Visual Basic .NET JavaScript C Perl PHP Delphi C++ Assembly PL/SQL Swift Ruby Prolog Bash Rust Transact-SQL Julia Crystal F# Ada ABAP Scala VBScript Erlang Kotlin Fortran ML D Awk Lua Logo LabVIEW Hack Lisp Scheme Alice Dart FoxPro Clojure Apex COBOL SAS ) ____

Sign In or Register to comment.