当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·入门问题    »显示摘要«
    摘要: 请说明为什么?如果去掉类定义中的virtual将输出什么? class a { public: void show(); private: virtual void showme(); } void a::show() { showme(); } void a::showme() { cout<<"a"; } class b:pblic a { privat......
    摘要: 我用vb 访问oracle数据库,连接字符串是oracle8i提供的oraoledb.oracle.1接口, 字符串为: gb_cn.open "provider=oraoledb.oracle.1;" & _ "data source=gaj;" & _ "user id=testuser;" &......


做题:Print #1, Chr(27) + Chr(74) + Chr(100) + Chr(27) + Chr(74) + Chr(100)是什么意思,

请问下面两几是什么意思?  
  1)        
  Print   #1,   Chr(27)   +   Chr(74)   +   Chr(100)   +   Chr(27)   +   Chr(74)   +   Chr(100)  
   
  2)  
  Open   "LPT1:"   For   Output   As   #1  
  Print   #1,   Chr(27)   +   Chr(64)   +   Chr(27)   +   Chr(50)   +   Chr(27)   +   Chr(67)   +   Chr(29)   +   Chr(27)   +   Chr(106)   +   Chr(100)   +   Chr(27)   +   Chr(106)   +   Chr(100)   +   Chr(27)   +   Chr(106)   +   Chr(75)  
 

NO.1   作者: Cooly

1.向句柄为1的对象中写入{ESC}Jd{ESC}Jd  
  2.输出到打印机:{ESC}@{ESC}2{ESC}C................................

NO.2   作者: liangfang

以   ASCII     方式写文件   MSDN   有详细介绍

NO.3   作者: Cooly

唉,你是问Print,#1,Chr(),Open,For,Output,As   这些是做什么用的?  
   
  Print:输出方法,配合Open就属于File   I/O,   如果直接调用,则是PrintScreen.  
  #1:是句柄为"1"的对象  
  Chr():是一个函数,可以将ASCII码转成字符。  
  Open:File   I/O的方法  
  For:在这里是Open方法中的关键字  
  Output:在这里是File   I/O的操作类型(输出)  
  ...  
  ...  
   
 

NO.4   作者: Cooly

Open   Statement   Example  
  This   example   illustrates   various   uses   of   the   Open   statement   to   enable   input   and   output   to   a   file.  
   
  The   following   code   opens   the   file   TESTFILE   in   sequential-input   mode.  
   
  Open   "TESTFILE"   For   Input   As   #1  
    Close   before   reopening   in   another   mode.  
  Close   #1  
   
  This   example   opens   the   file   in   Binary   mode   for   writing   operations   only.  
   
  Open   "TESTFILE"   For   Binary   Access   Write   As   #1  
    Close   before   reopening   in   another   mode.  
  Close   #1  
   
  The   following   example   opens   the   file   in   Random   mode.   The   file   contains   records   of   the   user-defined   type   Record.  
   
  Type   Record         Define   user-defined   type.  
        ID   As   Integer  
        Name   As   String   *   20  
  End   Type  
   
  Dim   MyRecord   As   Record         Declare   variable.  
  Open   "TESTFILE"   For   Random   As   #1   Len   =   Len(MyRecord)  
    Close   before   reopening   in   another   mode.  
  Close   #1  
   
  This   code   example   opens   the   file   for   sequential   output;   any   process   can   read   or   write   to   file.  
   
  Open   "TESTFILE"   For   Output   Shared   As   #1  
    Close   before   reopening   in   another   mode.  
  Close   #1  
   
  This   code   example   opens   the   file   in   Binary   mode   for   reading;   other   processes   cant   read   file.  
   
  Open   "TESTFILE"   For   Binary   Access   Read   Lock   Read   As   #1  
 

NO.5   作者: Cooly

Dim   MyChar  
  MyChar   =   Chr(65)         Returns   A.  
  MyChar   =   Chr(97)         Returns   a.  
  MyChar   =   Chr(62)         Returns   >.  
  MyChar   =   Chr(37)         Returns   %.  
 

NO.6   作者: zyl910

QB、VB1~3能得到正确结果  
   
  但自从VB4引入UniCode字符串后,直接Chr即有可能造成字符集映射错误  
  强烈建议用二进制方式操作,用Byte数组读写


    摘要: ? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE