Tapatalk

How to use Visual Basic wordfile for ASPX files case-insensitive?

How to use Visual Basic wordfile for ASPX files case-insensitive?

2
NewbieNewbie
2

    Oct 15, 2014#1

    I've inherited a number of .ASPX files, all in VB "flavor"...I use the Visual Basic syntax highlighting (I tried the user-contributed .ASPX and VB.Net, but they were not a close-enough match).

    My problem is that prior developers did not adhere to consistent casing with keywords, so instead of "If ... Then ... End If", I might see "if THEN ELSE end IF" (for example), or instead of Do While" I might see "DO while", "For ... Next" might be "FOR ... NEXT", etc..

    Is there a way to get the Visual Basic syntax highlighting to ignore case, and highlight the commands that have inconsistent case?

    Thanks,

    Eric Kestler

    6,685587
    Grand MasterGrand Master
    6,685587

      Oct 16, 2014#2

      Please read the complete post before doing anything.

      The wordfile vbscript.uew containing syntax highlighting language VBScript ASP contains already the keyword Nocase in first line and therefore interprets Visual Basic Script sections in *.aspx files not case-sensitive. Set caret into a Visual Basic Script section in your *.aspx files and you should see VBScript ASP in status bar at bottom of main application window.

      But if you see instead Visual Basic in status bar because of using visualbasic.uew, something is not configured right. This syntax highlighting language is case-sensitive. The file extension ASPX should be in wordfile html.uew. All the wordfiles can be found in directory displayed in configuration dialog for syntax highlighting opened with Advanced - Configuration - Editor Display - Syntax Highlighting.

      It is possible to auto-correct all keywords in a file by enabling Auto-correct keywords at Advanced - Configuration - Editor Display - Miscellaneous and using the script posted at convert all language keywords in a syntax highlighted file to upper case or the macro posted at auto correct an existing file. The script and the macro do both the same. They insert and immediately delete at beginning or end of a word a space character which triggers the auto-correct feature. Give that a try on a copy and compare the corrected copy with original file. If that works as expected, use it for all your files.

      But to make use of this correction method it would be necessary to remove keyword Nocase from wordfile and sort the keywords in the color groups with taking case into account using the macro SortLanguage from the ultimate syntax highlighting tools. So most likely as Visual Basic Script code is by default not case-sensitive it would be better to run several case-sensitive Replace in Files to correct all keywords in all files which is faster than running the script or macro on all files and gives you more control on what is changed in the files.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Oct 16, 2014#3

        Thank you, Mofi, I believe I understand.

        Follow-on question: since the vbscript.uew uses a "Nocase" in the first line, can this also be safely used in the Visualbasic.uew file?

        I'm using the Visual Basic syntax highlighting because I believe it is more complete for ASPX/VB.Net files than the VBScript syntax highlighting is...but I may be mistaken.

        6,685587
        Grand MasterGrand Master
        6,685587

          Oct 17, 2014#4

          Here is visualbasic.uew as installed with UE v21.30.0.1005 with Nocase and the words resorted now case-insensitive.
          visualbasic.zip (3.69 KiB)   110
          Not case-sensitive wordfile for Visual Basic.
          Best regards from an UC/UE/UES for Windows user from Austria