Sublime Forum

Classic ASP with VBScript

#1

After hours of frustration I’ve come to the conclusion that SublimeText thinks I’m using javascript despite setting the language and script type to VBScript. The only issue I’m really having is it cannot properly indent without braces. After a reindent of an entire file I end up with the code near the bottom force to the left due to improper handling of else as below.

        if request.QueryString("Page").count < 1 then
			page = 1
		else
		page = CInt(request.QueryString("Page"))
	end if

I did see a prior question where it was switched from VBScript to Javascript and while I know it’s not 2005 there is a lot of code that needs to be supported. :wink:

Thanks!

0 Likes

#2

Do you have a package installed for visual basic syntax?

0 Likes

#3

looks like a bug in the indentation rules - else at the end of the line doesn’t cause indentation of the following line.
Fixable with a patch to Packages/ASP/Indentation Rules.tmPreferences:

--- Shipped Packages/ASP/Indentation Rules.tmPreferences	2021-04-02 13:30:54
+++ Packages/ASP/Indentation Rules.tmPreferences	2023-06-28 09:11:50
@@ -13,7 +13,9 @@
 		<string>(?x)(^\s*(
 			((?i:private|public(?!\s+default))\s+)?(?i:function|sub|property)\s
 			|
-			(?i:class|if|select\s+case|with|do|for|while)\s
+			(?i:class|if|select\s+case|with|do|for|while|else)\s
+            |
+            (?i:else)\b
 		))</string>
 	</dict>
 </dict>
`
1 Like

#4

Thank you so much for your quick and CORRECT response! That worked!

0 Likes