View Single Post
  #3 (permalink)  
Old April 18th, 2014, 03:45 AM
Tandy1000SL GW-BASIC Tandy1000SL GW-BASIC is offline
Authorized User
 
Join Date: Apr 2009
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My largest VBS File is 208 KB in size.

Using 8-1/2"x14" Legal Paper in Landscape Orientation, it has 3752 Command Lines; which, includes White Space; and, prints out 42 Command Lines Per Page.

The top 1/3 of the Code is actually REM Command Lines that are devoted to Program Information (File Size & Computer System & Printer System & OS & Authors) and Table Of Contents and Authors' Notes and Edit Notes and other information.

The Actual Code Section is about 50 Pages in total. About 28 Pages are filled will Functional Code Sequences. The remaining pages are filled with REM Command Lines that Section the Code like Chapters in a book. About 3 Pages of these REM Command Lines are actually Game System Design Concept Tables.

Yea...An overabundance of REM Comments.

The Functional Code Sequences includes about 20 of my own Completed Function Sequences; and, about another 20 of my own Conceived Function Sequences that only have MsgBox Functions, and aren't Called by the Main Code Sections.

Because I can't do Visual Graphics Programming with Visual BASIC Script that I could do with GW-BASIC, my Visual BASIC Script Coding is basically simple VBS MsgBox Functions and simple VBS InputBox Function and simple Subroutines of my own creation like my "WorldTerrain" Function sequence listed below.

Code:
' D E C L A R E D   V A R I A B L E S

Dim dtmNumber     'Time generated by the "Time" Function during the RUNning of this Program / Multi-
 ' Generated
Dim dtmNumber0     'Time generated by the "Time" Function upon Starting this Program / Single-
 ' Generated
Dim dtmNumber1     'Time generated by the "Time" Function upon ENDing this Program / Single-
 ' Generated

Dim dtmSeed     'Seed Number generated by the "Time" Function during the RUNning of this Program /
 ' Multi-Generated
Dim dtmSeed0     'Seed Number generated by the "Time" Function upon Starting this Program / Single-
 ' Generated
Dim dtmSeed1     'Seed Number generated by adding the "dtmSeed"0" & "dtmSeed" Variables together /
 ' Multi-Generated

Dim ComputerGM     'Variable used for calling Game System Related Computer-Only Procedures

Dim TerrainType     'Variable used by the "WorldTerrain" Function for determing the Type Of Terrain
 ' Selected
Dim intTerrainType     'the Integer Value of the "TerrainType" Variable
Dim strTerrainType     'the String Value of the "TerrainType" Variable



' M A I N   P R O G R A M

'Computer Program Start Time
dtmNumber0 = Time
dtmSeed0 = Second(dtmNumber0)
MsgBox "C O M P U T E R   P R O G R A M   S T A R T   T I M E" & vbNewLine & vbNewLine & _
  "Time = " & dtmNumber0 & vbNewLine & _
  "Hour = " & Hour(dtmNumber0) & vbNewLine & _
  "Minute = " & Minute(dtmNumber0) & vbNewLine & _
  "Second = " & Second(dtmNumber0) & vbNewLine & vbNewLine & _
  "dtmSeed0 = " & dtmSeed0 & _
vbNewLine , , "[VBSplanetology.vbs]"

ComputerGM = WorldTerrain
MsgBox strTerrainType



' P R O G R A M   S E Q U E N C E S

Function WorldTerrain     'World Map Terrain Selection
	Randomizer = TimeSeeder     'using the "TimeSeeder" Function for generating a Random Seed
 ' Number
	Randomize dtmSeed1
	TerrainType = Rnd * 10
	intTerrainType = Int(TerrainType)
	If intTerrainType => 0 and intTerrainType =< 2 Then
		strTerrainType = "W"     'Water
	ElseIf intTerrainType = 3 or intTerrainType = 4 Then
		strTerrainType = "D"     'Dirt
	ElseIf intTerrainType = 5 or intTerrainType = 6 Then
		strTerrainType = "R"     'Rock
	ElseIf intTerrainType => 7 and intTerrainType =< 9 Then
		strTerrainType = "S"     'Sand
	Else
		MsgBox "Error -- 'WorldTerrain' Function" & _
		vbNewLine , , "[VBSplanetology.vbs]"
	End If     'intTerrainType
End Function     'World Terrain

Function TimeSeeder     'creates a Seed Number using the "Time" Function
	dtmNumber = Time
	dtmSeed = Second(dtmNumber)
	dtmSeed1 = dtmSeed0 + dtmSeed
	MsgBox "T I M E   S E E D E R" & vbNewLine & _
	  "Time = " & dtmNumber & vbNewLine & _
	  "Hour = " & Hour(dtmNumber) & vbNewLine & _
	  "Minute = " & Minute(dtmNumber) & vbNewLine & _
	  "Second = " & Second(dtmNumber) & vbNewLine & vbNewLine & _
	  "dtmSeed0 = " & dtmSeed0 & vbNewLine & _
	  "dtmSeed = " & dtmSeed & vbNewLine & _
	  "dtmSeed1 = " & dtmSeed1 & _
	vbNewLine , , "[VBSplanetology.vbs]"
End Function     'TimeSeeder
NOTE: I don't use the "Option Explicit" Command in my VBS Codes.

NOTE: I use the term "Sequences"; because, Subroutines & my own Function sequences go in this Section.
Reply With Quote