TAILIEUCHUNG - Microsoft WSH and VBScript Programming for the Absolute Beginner Part 27

Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 27. If you are new to programming with Microsoft WSH and VBScript and are looking for a solid introduction, this is the book for you. Developed by computer science professors, books in the for the absolute beginner series teach the principles of programming through simple game creation. You will acquire the skills that you need for more practical WSH and VBScript programming applications and will learn how these skills can be put to use in real-world scenarios. Best of all, by the time you finish this book,. | Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition Description This script demonstrates how to create open and write a line of text to a text file. Initialization Section Option Explicit Dim objFso objFileHandle strFileName Set objFso strFileName C Temp Main Processing Section OpenTextFile WriteTextOutput CloseTextFile TerminateScript Procedure Section Function OpenTextFile If exists open it in append mode otherwise create and open a new file If strFileName Then Set objFileHandle strFileName 8 Else Set objFileHandle strFileName 2 True End If Chapter 8 Storing and Retrieving Data End Function Function WriteTextOutput Write 3 lines of text to the text file Once upon a time there was a little boy who lived in a shoe. Unfortunately it was two sizes too small End Function Function CloseTextFile Close the file when done working with it End Function Function TerminateScript Stop the execution of this script End Function It is very important that you always remember to close any open files before allowing your scripts to end. You do this by using the FileSystemObject object s Close method as shown here If you forget to close a file after working with it the file might become corrupted because the end-of-file marker has not been created for it. You can only open a file using one mode at a time. In other words if you open a KpV file in ForReading mode your script cannot write new text to the file unless you first close the file and then open it again in ForWriting mode. Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition If you save and run this script and then open the file using Windows Notepad you ll see the output shown in Figure . Figure Writing to a new or .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.