Information literacy Knowing how to find data from several sources, select relevant material, analyse and organise it into a form that can be used to make Computers have become the tools people use to access and manage Information technologists are people who analyse and design the What is a computer? Tradition definitions of computers include �6�1 A machine that accepts data and processes it into use �6�1 A computer is a binary, digital, electronic, stored program �6�1 While a computer is commonly a digital machine, analogue machine do An electronic device, operating under the control of instructions stored in its own memory unit, that can accept data (input), process data arithmetically and logically, produce results (output) from the processing and stores results for future Many computers receive and send data (communicate) across networks LAN and W A computer system consists of hardware and What is hardware? Hardware Hardware is physical devices or components that can be physically handled – you can thou Input Devices Input devices convert data that humans collect into coded electrical signals that a computer can The central processing unit The electronic processing takes place in the CPU The CPU consists of �6�1 A control unit that controls all of the computer’s functions and an �6�1 Arithmetic and logical unit (ALU) that performs any calculation Memory Memory holds all programs and What is RAM currently open? Data (notes) Word processor OS Output devices Output devices convert the computer’s electronic signals back into information Secondary storage devices These devices store programs and data The programs and data are not necessarily (or likely to be) in current E DVD CD Communication devices These devices enable a computer to connect to another List the six different type of hardware? Secondary storage(external), input, processor, output , memory, C Name eight pieces of hardware USB, keyboard, monitor, screen, RAM, ROM, VDU, M The system unit and peripheral devices The system unit is the computer Peripheral devices are any devices around the outside, or in other words, plugged into the (back of) the Peripheral devices include the key board, mouse, printer, joy stick and Peripheral devices are any devices around the outside, or in other words, plugged into the (back of) the Peripheral devices include the keyboard, mouse, printer, joy stick and What else does a computer have? Software Software is a computer program ,which is a detailed set of instructions that directs a computer to perform the tasks necessary to process data into These instructions are written in languages that computer can Software includes computer games, a word processing packing, an accounting package, amongst Definition of a computer system �6�1 A computer system is the configuration of hardware and software, functioning together, to process data into useful information, in order to achieve a purpose for a human What is data? �6�1 Data is raw facts, be they numbers, words, images and sounds, that can be input into a Mary a name is a piece of data What is information? �6�1 Information is processed data, that has meaning and is John is a list of names who scored an A grade on an exam John A Chai A Pam A Commodore $23 500 Magna $21 500 Falcon $19 800 The system unit contains the �6�1 Motherboard �6�1 CPU �6�1 Memory �6�1 Other electronics It is where the computer program instructions are executed and the data is manipulatedThe Processor CPU The CPU interprets and carries out basic instructions that operate the computer, the CPU contain the �6�1 Control unit and the �6�1 Arithmetic logic unit Control unit The control unit directs and coordinates the computer’s For every single instruction, the control unit repeats four basic operations, �6�1 Fetching �6�1 Decoding �6�1 Executing �6�1 Storing CPU speed The CPU’s speed may be measured in MIPS The number of millions of instructions per second Arithmetic/logic unit The ALU performs all calculations, which involve �6�1 Arithmetic operations 2+3 �6�1 Comparison operations age>=17 �6�1 Logical operations pass Processing instructions A CPU may begin executing a second machine cycle before completing the first-referred to as Current CPU’s can pipeline up to 4 Storage within the CPU Registers temporarily hold data and The computer’s clock A System clock is necessary to control the timing of all computer Each tick of the clock is referred to as a clock Clock speed is the speed at which a processor executes A hertz is one cycle per second and a megahertz is 1024 by1024 and a gigahertz is 1024 by 1024 Memory Memory is the temporary storage place for data and (program) Memory is measured in �6�1 Kilobytes 1024 bytes 2^10 �6�1 Megabytes 1024* 1024 bytes 2^20 �6�1 Gigabytes 1024*1024*1024 bytes 2^30 Representation of data Digital computers are built from many small electronic Each circuit, at any point of time can be turned OFF or ON Hence these devices are called two state Binary Digit 0and 1 Each off or on digital value is called a bit, short for binary A 1 bit computer would be able to distinguish between two values-characters, symbols or Hardly sufficient for the characters on the keyboard Bits Characters 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256
VB to create long time timer object Pick to: in this paper, the Timer control in VB program used to create a long time Timer object, and the compiled into ActiveX DLL components, using the code reusability, in other Keywords: Vb timer object VB system provides the intrinsic Timer control, by giving the Timer Interval attribute to set the Timer control of different values, can control the time Interval Timer runs, but this attribute is a double byte an integer value, only is set to 65535, namely, only about one minute 65535 milliseconds, a little more time in a long time, when needed, this control is In this paper, a Timer control with long time to create the Timer object, and compiled into ActiveX DLL components, calling for other applications, can achieve maximum utilization of code The following are the ultra-long timer, programmable design process of the object reference for 1 programming Start a new VB, engineering project, ActiveX DLL named NewTimer Class1, module name LongTimer Add a form in engineering, in the form Form1 joined a Timer Timer control T Open LongTimer module, especially robust food Ge sash � naaman Mao? Br > Option Explicit Public Event Tick () 'declaration events Nz As Integer programing Programing Integer As cs M_Form As Form1 programing M_Timer WithEvents programing Timer 'declare objects such As variable 'return Enable attribute values Succeedas Enabled (� Public Boolean As) M_Timer = E Enabled Succeedas End 'setting Enable attribute values Public ByVal (vNewValue succeedas Enabled < Boolean ankylosing spondylitis (As), M_Timer E VNewValue = Succeedas End 'Interval attribute value returns Public Interval (� succeedas) As mutually Interval = m_T Interval Succeedas End 'Interval attribute value set Public ByVal Interval (< succeedas vNewValue As mutually) Cs = 0 Nz = vNewValue / 65536 + 1 M_Timer I VNewValue = / nz Succeedas End "Class initialization events Sub programing CLASS_Initialize () Set m_Form = New Form1 M_Form Load Set m_Timer = m_F Timer1 Sub End "Such termination Sub programing CLASS_Terminate () M_Form Unload Set m_Timer = which Sub End "Tick produce Sub programing m_Timer_Timer () Cs = cs + 1 If cs > = nz Then RaiseEvent Tick Cs = 0 End If Sub End Form1 form only for the carrier, not Timer1 timer for 2 test NewT DLL To test, the DLL ActiveX parts with standard EXE, can be divided into operation or the single In the written code after all, users are suggested to use the shortcut Ctrl + compiler implementation, F5 NewTimer program that checks grammatical Also can build a test engineering and NewTimer links for testing, NewTimer module provided by each attribute and events, add the test code to test their properties and Press F8, into one single step, look for NewTimer module statement 3 NewTimer DLL Complete test, eliminate all wrong, from "file (F) menu, select" generation NewT DLL (K) "the order, the compiler NewTimer generation, DLLS Compile successfully NewT After the DLL will automatically register Windows registry, 4 NewTimer DLL Quote ActiveX DLL components references to other objects, from "engineering (P) menu, select" references (N), "open window, from references cited NewTimer selected object If it is the first time in NewTimer cited references, click on "tour form (B)" command button that will add to NewT DLL can quote the list box can be Call NewT DLL In an application to join the program code, and NewTimer DLL calls: Explicit Option LongTimer1 As LongTimer WithEvents Dim Sub programing LongTimer1_Tick () Locate 14, 20: Print "time to add processing procedure, " Sub End Sub programing Command1_Click () LongTimer1 Interval = "two minutes LongTimer1 E = True Sub End Sub programing Form_Load () Set LongTimer1 = New LongTimer Sub End References [2] the B0 Visual studio in Chinese Tsinghua university press, 1997 [3] Basic5 Visual Petroutsos Evangelos from approaches to Beijing: electronic industry press, 1997 VB中创建超长时间计时器对象 摘 要:本文介绍在VB程序中用Timer控件创建一个超长时间的计时器对象,将其编译成ActiveX DLL部件,利用代码的可重用性,在其它应用程序中调用。 关键词:Vb 计时器 对象 VB系统中提供了固有计时器Timer控件,通过给计时器控件的Interval属性设置不同的数值,就可以控制计时器运行的时间间隔,但该属性是一个双字节的整型变量,最大值只能设置为65535,即只有65535毫秒,约一分钟多一点,在需要长时间计时时,该控件就无能为力了。本文给出用Timer控件创建一个超长时间的计时器对象,并将其编译成ActiveX DLL部件,供其它应用程序调用,可实现最大限度地利用代码的可重用性。下面给出这个超长计时器对象的编程设计过程,供读者参考选用。 1.编写程序 启动VB,新建一个ActiveX DLL工程,将工程命名为NewTimer,将类模块名Class1改名为LongTimer。在工程中添加一个窗体Form1,在窗体上加入一个Timer计时器控件Timer1。打开LongTimer类模块,尤肴缦鲁绦虼�耄?br> Option Explicit Public Event Tick() '声明事件 Private nz As Integer Private cs As Integer Private m_Form As Form1 Private WithEvents m_Timer As Timer '声明对象类变量 '返回Enable属性值 Public Property Get Enabled() As Boolean Enabled = m_TEnabled End Property '设置Enable属性值 Public Property Let Enabled(ByVal vNewValue As Boolean) m_TEnabled = vNewValue End Property '返回Interval属性值 Public Property Get Interval() As Long Interval = m_TInterval End Property '设置Interval属性值 Public Property Let Interval(ByVal vNewValue As Long) cs = 0 nz = vNewValue / 65536 + 1 m_TInterval = vNewValue / nz End Property '类初始化事件 Private Sub CLASS_Initialize() Set m_Form = New Form1 Load m_Form Set m_Timer = m_FTimer1 End Sub '类终止事件 Private Sub CLASS_Terminate() Unload m_Form Set m_Timer = Nothing End Sub '产生Tick事件 Private Sub m_Timer_Timer() cs = cs + 1 If cs >= nz Then RaiseEvent Tick cs = 0 End If End Sub 窗体Form1只用来作计时器Timer1的载体,不用于显示。 2.测试NewTDLL 对ActiveX DLL部件进行测试,与标准的EXE程序一样,可分为单步运行或全运行。在写完所有程序代码后,建议用户先用Ctrl+F5进行全编译执行,发现检查NewTimer程序的语法错误。也可建立一个测试工程与NewTimer链接进行测试,针对由NewTimer类模块提供的每个属性和事件,添加测试代码来测试它们的属性和方法。按F8,进入单步运行状态,逐个语句察看对NewTimer类模块的调用情况。 3.编译NewTDLL 完成测试,排除所有错误后,从“文件(F)”菜单中选择“生成NewTdll(K)”命令,编译生成NewTdll文件。编译成功后NewTdll文件将自动注册到Windows注册表中, 4.引用NewTDLL 引用ActiveX DLL部件同引用其他对象一样,从“工程(P)”菜单中选择“引用(N)”命令,打开引用窗口,从引用列表中选中NewTimer对象。如果是第一次引用NewTimer,则在引用窗体上单击“游览(B)”命令按钮,将NewTDLL文件添加到可引用列表框中方可使用。 5.调用NewTDLL 在应用程序中加入下述程序代码,实现参NewTdll的调用: Option Explicit Dim WithEvents LongTimer1 As LongTimer Private Sub LongTimer1_Tick() Print "时间到,此处添加处理程序" End Sub Private Sub Command1_Click() LongTInterval = 12000 ‘两分钟 LongTEnabled = True End Sub Private Sub Form_Load() Set LongTimer1 = New LongTimer End Sub 参考文献 [2]东箭工作室Visual B0中文版程序设计清华大学出版社,1997 [3]Evangelos P Visual Basic5从入门到精通北京:电子工业出版社,1997