Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

[RESOLVED] PAD in vbscript

$
0
0
I hope someone can help me. I have been unable to find anything on the net anywhere about this. I had to create a script for a class. A lot of it was given to us to use and not necessarily explained. Below is part of what was given.

' Display Headers
recordsStr = "Computer Room_Num" & _
" Speed Num_CPUs OS_Type " & _
" HDD_Size" & vbCrLf & _
"============================================================" & _
"===================" & vbCrLf
Do Until objRecordSet.EOF
recordsStr = recordsStr & pad(objRecordSet.Fields.Item("Computer"),15) & _
vbTab & pad(objRecordSet.Fields.Item("Room_Num"),7) & _
vbTab & pad(objRecordSet.Fields.Item("Speed"),7) & _
vbTab & objRecordSet.Fields.Item("Num_CPUs") & _
vbTab & pad(objRecordSet.Fields.Item("OS_Type"),18) & _
vbTab & objRecordSet.Fields.Item("HDD_Size") & vbCrLf
objRecordSet.MoveNext


Here is my question - how does the pad work? I understand that you need the pad "command" before the objRecordSet and the numeric value after the string but what does the numeric value do? Is it a value of spacing from left to right with the text in the middle or is it the spacing after the text? Is it some magic number? I don't know how to truly use it and it's driving me nuts.

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>