Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ���ܵ�Сʨ
Thu, 07 May 1998 00:00
Visual BasicҲ����2000������
Author: ���ܵ�Сʨ
Date: Thu, 07 May 1998 00:00
Date: Thu, 07 May 1998 00:00
82 lines
6093 bytes
6093 bytes
Visual Basic(���¼��VB)���������ѧ���ص��ΪĿǰWindows
��������Ҫ����,�����뵽û��,��������������֮ʱ,���VB�����
������?
�����о��Ľ��˵��VB��2000������Ƚϸ���,��汾����,�ּ�
Ҫ˵�����¡�
Ϊ�˿���VB��2000������,���߱�д��������γ���:
Dim sDate As String
Dim vDate As Variant
sDate = "Jan 1 01"
vDate = CVDate(sDate)
Debug.Print "Now = " & Now
Debug.Print "sDate = " & Format$(sDate, "dd/mm/yyyy")
Debug.Print "vDate = " & Format$(vDate, "dd/mm/yyyy")
����γ�����ÿ���汾��VB��������,��һ������ϵͳʱ�����
�����͵�ʱ��1997��8��9��,��һ��ʹ�������͵�ʱ��2000��8��9��
������������֮��,�ó����½��
��VB 3.0��,��������:
Now = 97/08/09 3:06:48 PM
sDate = 01/01/1901
vDate = 01/01/1901
Now = 2000/08/09 3:08:11 PM
sDate = 01/01/1901
vDate = 01/01/1901
�ӽ�������ǿ��Կ���,����VB3.0���еñȽ���,��ʱ2000����
�û���������ǵ�ע��,����VB 3.0���κ���ݶ����ɱ����͵ġ�
Ҳ����˵,���ܻ������������:��ij����������ͻ�ͻȻʹʱ�
��100�ꡣ�ڲ����л�����Format�����Year����صĽ����һ��
��,��˵����VB 3.0��ֻ����һ�ּ������͵ķ�����
VB 4.0�е������3.0�渴�Ӷ��ˡ����ȿ���16λ�汾��������
���ԵĽ��:
Now = 97/08/09 3:06:48 PM
sDate = 01/01/1901
vDate = 01/01/1901
Now = 2000/08/09 3:08:11 PM
sDate = 01/01/2001
vDate = 01/01/2001
VB 4.0��16λ�Ǹ�ݵ�ǰϵͳ�������ж����͵ġ�����ǰ���Ϊ
1997,�õ�������Ϊ2���͵�,����ǰ���Ϊ2000��,�õ�������Ϊ21��
�͵ġ���Ҳ���ܻ��������,����2000�괦��1999�����Ŀʱ,VB����
Ϊ����2099��ġ�
VB 4.0��32λ�汾,�õ��Ľ�������16λ�汾��ͬ,Ҳ���ܲ�ͬ
��������ΪVB 4.0��2 λ�汾�����ں���(��DateSerial��������)��
��OleAut32.dll�õ�������ݵġ�VB 4.0��3 2λ�汾��������2.1
0�汾,����õķ���ͬVB 4.0��16λ�汾һ�����VB 4.0���к�,
��Ҳ��ʶ���������͵ķ�����������,����������е�2.20��
�ʹ˺�İ汾�в������µķ������·�����Ϊ,�����ݵĺ���λ��3
0��99֮��,����Ϊ��20����,������00��29֮��,����Ϊ��21���͡���
���ԱȽϺõؽ������ĩ���ʱ�ڵ���������,����2030�꼰�Ժ���
ô��,ֻ�ܵ�ʱ����˵�ˡ���1996���Ժ��Ƴ�������а�����OleAu
t32.dll���Dz��ô˷���,��Щ�������Internet Explorer 3.0��Win
dows NT 3.51 Service Pack 5��WindowsT 4.0��Windows 95 OSR 2(
�׳�Windows 96)��Office 97��Visual Studio 97�ȵȡ�VB 50Ҳ��
�ô˷���������û���VB 4.0��32λ�汾������ǰ��IJ��Գ���õ�
�Ľ��ͬ16λ�汾��ͬ,˵����OleAut32.dll���ϰ汾,����Ϊ�°汾
���ɼ�,VB 4.0��32λ�汾�õ��Ľ��ȡ����OleAut32.dll �İ汾��
��Ҫ˵������,DateSerial�����Ǵ�OleAut32.dll�õ�������ݵ�,
����VB��16λ��32λ�汾�в��õķ�����һ��ġ�
������VB�����汾����������Ĵ��?���������������ں���
�й�,���߽�������Զ��庯����ȷ�����͡�����,��Ϊ80����99���
���ڶ��DZ�����,��00����79��Ϊ�����͡����Ա�д���µij�������
����λ��ݡ�
Sub MyYear( vDate As Variant) As String
Dim s As String
If Format$( vDate, "yy") < "80" Then
s = "20"
Else
s = "19"
End If
MyYear = s + Format$( vDate, "yy")
End Sub
����,��Ӧ����������ij���,��Ҫ��������2000��Ԫ���Ľ���
��������鷳
--
________ _____ _____ ______________ _____
___ __ \___(_)________ ___(_) __ ___/___ /_ ___(_)
__ /_/ /__ / ___ __ \__ / _____ \ __ __ \__ /
_ ____/ _ / __ /_/ /_ / ____/ / _ / / /_ /
/_/ /_/ _ .___/ /_/ /____/ /_/ /_/ /_/
/_/
[m[1;36m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads