| OpenTextFile() | ใช้สร้างออปเจ็ค TextStream |
|---|
method:OpenTextFile ( filename, typework, new, typeopen )
return type:Object
content:ใช้สร้างออปเจ็ค TextStream
example:Set fsystem = CreateObject ( “Scripting.FileSystemObject” ) Set tstream = fsystem.OpenTextFile ( “bamboo.txt”, 2, true, 0 )
comment:typework คือ 1 หมายถึงอ่านอย่างเดียว, 2 หมายถึง แก้ไขไฟล์ได้, 8 หมายถึง เพิ่มข้อมูล new คือถ้ากำหนด true หมายถึงถ้าไม่มีไฟล์นั้นอยู่ให้สร้างใหม่เลย typeopen คือ -2 คือเปิดแบบ default (ตามไฟล์), -1 คือเปิดแบบ Unicode, 0 คือเปิดแบบ ascii