2011-07-01から1ヶ月間の記事一覧
まんま MsgBox Minute(Now)
MsgBox Mid("abc", 1) ' abc MsgBox Mid("abc", 2) ' bc MsgBox Mid("abc", 4) ' MsgBox Mid("abc", 1, 1) ' a
MsgBox Len(LTrim(" abc ")) MsgBox Len(RTrim(" abc ")) MsgBox Len(Trim(" abc ")) MsgBox Len(Trim(Chr(9) & "abc" & Chr(9))) タブにはきかない???
MsgBox Log(1) MsgBox Log(2.718282)
Set p = LoadPicture("c:\foo.jpg") MsgBox p.Width MsgBox p.Height
MsgBox Len("abc") ' 3 MsgBox Len(123) ' 3
MsgBox Left("ABC", 1) ' A MsgBox Left("ABC", 0) ' MsgBox Left("ABC", 2) ' AB MsgBox Left("ABC", 4) ' ABC
MsgBox LCase("ABC") MsgBox LCase("abc") MsgBox LCase("Abc123") MsgBox LCase("ABC")
Dim array1(3) Dim array2(3,4) MsgBox LBound(array1) MsgBox LBound(array2, 1) MsgBox LBound(array2, 2)
Dim array(3) array(0) = "foo" array(1) = "bar" array(2) = "baz" MsgBox Join(array) MsgBox Join(array, ", ") Perl とかでイメージするのとは違って、終端にも delimiter が付くようだ
ほぼ、まんま Set MyObject = Me MsgBox IsObject(MyObject) ' True MsgBox IsObject(1) ' False Me って何?
MsgBox IsNumeric(1) ' True MsgBox IsNumeric(-1) ' True MsgBox IsNumeric(1.2) ' True MsgBox IsNumeric("1e1") ' True MsgBox IsNumeric("1,000,000") ' True MsgBox IsNumeric("1,000,00") ' True MsgBox IsNumeric("123") ' True MsgBox IsNumeric(…
MsgBox IsNull(x) ' False Dim x MsgBox IsNull(x) ' False x = 1 MsgBox IsNull(x) ' False x = Null MsgBox IsNull(x) ' True x = Empty MsgBox IsNull(x) ' False
MsgBox IsEmpty(x) ' True Dim x MsgBox IsEmpty(x) ' True x = 1 MsgBox IsEmpty(x) ' False x = Null MsgBox IsEmpty(x) ' False x = Empty MsgBox IsEmpty(x) ' True
MsgBox IsDate("October 19, 1962") ' True MsgBox IsDate(#10/19/62#) ' True MsgBox IsDate("foo") ' False MsgBox IsDate("November 30, 1962") ' True MsgBox IsDate("November 31, 1962") ' False 関係ないけど、複文?は「:」でつなげるんだね〜
Dim array(3) array(0) = 1 MsgBox IsArray(array) ' True MsgBox IsArray(x) ' False MsgBox IsArray(1) ' False
MsgBox InStrRev("abcabc", "ab") ' 4 MsgBox InStrRev("abcabc", "ab", 2) ' 1 MsgBox InStrRev("abcabc", "ab", 1) ' 0 MsgBox InStrRev("abcabc", "cd") ' 0
MsgBox InStr("abcde", "ab") ' 1 MsgBox InStr("abcde", "cd") ' 3 MsgBox InStr("abcde", "CD") ' 0 MsgBox InStr(2, "abcde", "ab") ' 0 日本語の扱い不明
MsgBox InputBox("Hi!") MsgBox InputBox("Hi!" & Chr(13) & "Hey!") MsgBox InputBox("Hi!", "Title") MsgBox InputBox("Hi!", "Title", "Default") MsgBox InputBox("Hi!", "Title", "", 10, 100) 最後の引数、ヘルプまわりは深く追求せず
MsgBox Hour(Now) MsgBox Hour(#4:45:23 PM#) ' 16
MsgBox Hex(1) ' 1 MsgBox Hex(10) ' A MsgBox Hex(16) ' 10 MsgBox Hex(16.4) ' 10 MsgBox Hex(16.5) ' 10 MsgBox Hex(-1) ' FFFF MsgBox Hex(-16.4) ' FFFFFFF0 MsgBox Hex(-16.5) ' FFFFFFF0 MsgBox Hex(&HF) ' F
まんま <SCRIPT LANGUAGE="VBScript"> Function GetRefTest() Dim Splash Splash = "GetRefTest Version 1.0" & vbCrLf Splash = Splash & Chr(169) & " YourCompany 1999 " MsgBox Splash End Function Set Window.Onload = GetRef("GetRefTest") </SCRIPT>
MsgBox GetObject("C:\foo.jpg") ' [object]
MsgBox GetLocale ' 1041
MsgBox FormatPercent(1) ' 100.00% MsgBox FormatPercent(1, 4) ' 100.0000% MsgBox FormatPercent(0.0001, 2, TristateTrue) ' .01%
MsgBox FormatNumber(1.23456789) ' 1.23 MsgBox FormatNumber(1.23456789, 2) ' 1.23 MsgBox FormatNumber(1.23456789, 3) ' 1.235 MsgBox FormatNumber(1.23456789, 4) ' 1.2346 MsgBox FormatNumber(0.1, 2, TristateFalse) ' .10 MsgBox FormatNumber(10…
MsgBox FormatDateTime("2011-07-05") ' 2011/07/05 MsgBox FormatDateTime("2011-07-05", vbGeneralDate) ' 2011/07/05 MsgBox FormatDateTime("2011-07-05", vbLongDate) ' 2011年7月5日 MsgBox FormatDateTime("2011-07-05", vbShortDate) ' 2011/07/05 M…
MsgBox FormatCurrency(1000) ' \1,000 MsgBox FormatCurrency(-1000, -1, -1, -1, 0) ' (\1000)
MsgBox Int(1.2) ' 1 MsgBox Int(1.5) ' 1 MsgBox Fix(1.2) ' 1 MsgBox Fix(1.5) ' 1 MsgBox Int(-1.2) ' -2 MsgBox Int(-1.5) ' -2 MsgBox Fix(-1.2) ' -1 MsgBox Fix(-1.5) ' -1 MsgBox Int("1.2")
Dim StrArray(6) StrArray(0) = "Sunday" StrArray(1) = "Monday" StrArray(2) = "Tuesday" StrArray(3) = "Wednesday" StrArray(4) = "Thursday" StrArray(5) = "aWed" x = Filter(StrArray, "Mon") MsgBox x(0) x = Filter(StrArray, "T") MsgBox x(0) & "…