S
S
starkdm2015-06-22 19:20:53
VBScript
starkdm, 2015-06-22 19:20:53

Are there any rules for formatting VBScript code?

For example, in Windows there are some system scripts in VB and they have the following design (a piece of code):

'******************************************************************************
'Microsoft Confidential. © 2002-2003 Microsoft Corporation. All rights reserved.
'
' This file may contain preliminary information or inaccuracies, 
' and may not correctly represent any associated Microsoft 
' Product as commercially released. All Materials are provided entirely 
' “AS IS.” To the extent permitted by law, MICROSOFT MAKES NO 
' WARRANTY OF ANY KIND, DISCLAIMS ALL EXPRESS, IMPLIED AND STATUTORY 
' WARRANTIES, AND ASSUMES NO LIABILITY TO YOU FOR ANY DAMAGES OF 
' ANY TYPE IN CONNECTION WITH THESE MATERIALS OR ANY INTELLECTUAL PROPERTY IN THEM. 
'******************************************************************************

Option Explicit

Wscript.Echo "" 
Wscript.Echo "REGISTER_APP.VBS version 1.6 for Windows Server 2008"
Wscript.Echo "Copyright (C) Microsoft Corporation 2002-2003. All rights reserved."
Wscript.Echo "" 


'******************************************************************************
' Parse command line arguments
'******************************************************************************
Dim Args
Set Args = Wscript.Arguments
If Args.Count < 1 Then 
  PrintsUsage
End If

Dim ProviderName, ProviderDLL, ProviderDescription
If Args.Item(0) = "-register" Then 
  If Args.Count <> 4 Then PrintsUsage

  ProviderName = Args.Item(1)
  ProviderDLL = Args.Item(2)
  ProviderDescription = Args.Item(3)

  UninstallProvider
        ...

By formatting, I mean any special instructions in the comments (script name, purpose, author, etc.), a certain location of these comments, separating lines (separate some functional modules of the script for convenience), indents, etc. Rules of the Hungarian I know the notations and I don't need them, because the question is not about the correctness of the code or the naming of variables.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-06-22
@Stalker_RED

There are style guides

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question