这一句代码错在哪儿呢?

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

声明语句:dim   mybirthday   as   data   =   #24/3/1974#  
  在“#24/3/1974#”有波浪线,揭示“日期常数无效”。  
  这一句代码错在哪儿呢?  
   
   
  完整的代码是:  
  module   module1  
   
          sub   main()  
                  dim   myname   as   string,   firstname   as   string   =   "li",   secondname   as   string   =   "   peiyou   "  
                  myname   =   firstname   &   secondname  
                  console.writeline(myname   &   "is   my   name.")  
                  dim   mybirthday   as   data   =   #1974#    
   
   
          end   sub  
   
  end   module  
 

· 网友精彩回答:

发表者:saucer

try  
   
  dim   mybirthday   as   date   =   #3/24/1974#  
  console.writeline(mybirthday)  
   
  or   you   really   should   be   doing   something   like  
   
  mybirthday   =   new   datetime(1974,4,2)    
   
  console.writeline(mybirthday)

发表者:feihu_02

dim   mybirthday   as   data   =   #24/3/1974#  
  这句写错了,    
  dim   mybirthday   as   date=   "24/3/1974"  
 

发表者:jiekewei

#月/日/年#    
   
  类是   date   不是   data     !!!!!!  
   
  ^_^

发表者:haitao5676

你的变量也申请错了,data不是数据类型  
  应该是date

.
处理 SSI 文件时出错
© 2006-2008 All Rights Reserved