找考题网-背景图
未分类题

在窗体中添加一个命令按钮Commandl和一个文本框Text1,编写命令按钮Com-mand1 的 Click事件代码; Private Sub Command1_Click() Dim S As String*20 S=TextText End Sub 该程序的功能是当单击按钮Command1时,把变量S中内容写入一个顺序文件 datl. dar中,正确的程序段是 ( )
A.Open 'datl. dat', For lnput As#1 Write井1,S
B.Open'datl. dat' For Output As#1 Write#1, S
C.Open'dat', For Binary As #1 Write #1, S Close #1
D.Open datl. dat'For Random As #1 Write #1, S Close #1

A.Open
B.Open'datl.
C.Open'dat',
D.Open

【参考答案】

B
解析:引用文件时首先必须将文件打开或建立,可以使用Open语句完成这一工作。
Open语句的格式:
Open pathname For打开方式[Access存取类型][锁定]As[#]文件号[Len=记录长度]题中主要考查了打开方式参数,打开方式有五种,分别为Append...

(↓↓↓ 点击‘点击查看答案’看完整答案 ↓↓↓)
热门试题

未分类题The full influence of mechanization began shortly after 1850, when a variety of machines came rapidly into usE.The introduction of these machines frequently created rebellions by workers who were fearful that the machines would rob them of their work. Patrick Bell, in Scoffland, and Cyrus McCormick, in United States, produced threshing machines. Ingenious improvements were made in plows to compensate for different soil types. Stream power came into use in 1860s on large farms. Hay rakes, hay-loaders, and various special harvesting machines were produceD.Milking machines appeareD.The internal-combustion engine run by gasoline became the chief power source for the farm.In time, the number of certain farm machines that came into use skyrocketed and changed the nature of fanning. Between 1940 and 1960, for example, 12 million horses and mules gave way to 5 million tractors. Tractors offer many features that are attractive to farmers. There are, for example, numerous attachments: cultivators that can penetrate the soil to varying depths, rotary hoes that chop needs; spray devices that can spray pesticides in bands 100 feet across, and many others.A piece of equipment has now been invented or adapted for virtually every laborious hand or animal operation on the farm. In the United States, for example, cotton, tobacco, hay, and grain are planted, treated for pests and diseases, fertilized, cultivated and harvested by machinE.Large devices shake fruit and nut from trees; grain and blend feed, and dry grain and hay. Equipment is now available to put just the right amount of fertilizer in just the right place, to spray and exact row width, and to count out, space, and plant just the right number of seeds for a row.Mechanization is not used in agriculture in many parts of Latin America, AfricA.Agriculture innovation is accepted fastest where agriculture is already profitable and progressivE.Some mechanization has reached the level of plantation agriculture in parts of the tropics, but even today much of that land us laboriously worked by people leading draft animals pulling primitive plows.The problems of mechanization in some areas are not only cultural in naturE.For examples, tropical soils and crops differ markedly from those in temperate areas that the machines are designed for, so adaptations have to be madE.But the greatest obstacle to mechanization is the fear in underdeveloped countries that the workers who are displaced by machines would not find work elsewherE.Introducing mechanization into such areas requires careful planning.The first paragraph uses several examples to convey the ideas that ______.A.the introduction of machines into agricultural work created rebellions on the part of the farmersB.the use of internal-combustion engine as a chief power source for the farm produced great influenceC.the mechanization of agricultural work after 1850 gradually robbed many farmers of their workD.ingenious improvements were made in fanning machines in the 1860s to yield production

A.B.
C.
D.
E.
The
F.
A.the
G.the
H.the
I.ingenious