VBA vs ASP Classic

Differences between coding in VB in Classic ASP (aka VBScript) and VBA (aka Visual Basic for Application).
This is planned to be an ongoing post, get back here as we are discovering more and more differences.

What is this?



Original Work
1: ASP may not have Optional used in Sub or Function line
2: ASP cannot do Goto [confirmed]
3: ASP cannot assign type to function on function line
4: ASP Cannot have Dim Arra(1 to 9), just Arra(9)
5: ASP cannot do Next I to close a For loop, just Next
6: Gosub - Return DOES NOT work :(
7: Use FormatNumber() instead of Format()
8: ASP get type of variable using VarType(), 0,1,2,3,4,5,6,7,8,9,10, etc; see www.csidata.com/custserv/onlinehelp/vbsdocs/vbs218.htm
    VBA get type of variable using TypeOf()
9: Use Cint() instead of Val()
10: Use Fix() instead of VAL()
    For Items 9 and 10
    Do not use cint in classic asp instead use fix
    fix() is like int(), cint is rounding and will not help here
11: ASP cannot have type defined in Dim, just variable. "Dim I As Interger" will error, "Dim I"] will work
12: ASP does not have IIF, VBA does.

Differences between ASP Classic vs VB.NET
1: Array definition and redim in ASP Classic as
    Dim Array()
    Rows = Rows + 1
    Redim Array(23, Rows)
Versus VB.NET
    Dim Array(1, 2)
    Rows = Rows + 1
    Redim Array(23, Rows)

Views 2,420

Downloads 873