Tải bản đầy đủ - 0 (trang)
Appendix G.  VB 6 Language Elements No Longer Supported

Appendix G.  VB 6 Language Elements No Longer Supported

Tải bản đầy đủ - 0trang

CurrencyDataType Datatypeforaccuratefinancialcalculations;replacedbytheDecimal

datatype



CVarFunction



ConvertsanexpressionintoaVariantdatatype



CVDateFunction



ReturnsaDatevariant



CVErrFunction



Returnsanerrorfromaprocedure



Date,Date$

Functions



Returnsthecurrentsystemdate;replacedbytheDateTime.Today

property



DateStatement



Setsthecurrentsystemdate;replacedbytheDateTime.Today

property



Debug.Assert

Statement



ConditionallysuspendsexecutionbasedonaBooleantest;consider

replacementwiththeDebug.AssertmethodintheSystem.Diagnostics

namespace



Debug.Print

Statement



SendsoutputtotheImmediatewindow;considerreplacementwith

theDebug.WriteLinemethodandsimilarmethodsinthe

System.Diagnosticsnamespace



DefBoolStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasBoolean



DefByteStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasByte



DefCurStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasCurrency



DefDateStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasDate



DefdblStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasDouble



DefdecStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasDecimal



DefintStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular



alphabeticalcharactersasInteger

DefLngStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasLong



DefobjStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasObject



DefsngStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasSingle



DefstrStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasString



DefVarStatement



Definesallotherwiseundeclaredvariablesbeginningwithparticular

alphabeticalcharactersasVariant



DoEventsStatement Releasescontroltotheapplication'smessagequeue;replacedwith

theDoEventsmethodintheWindows.Formsnamespace,orinVisual

Basic2005withtheMy.Application.DoEventsmethod

EmptyKeyword



Indicatesanemptyoruninitializeddatavalue;replacedbytheNothing

keyword



EqvOperator



Representsalogicalequivalenceoperator;usetheEqualTo(=)

comparisonoperatorinstead



ErrorFunction



Returnsastandarddescriptionofaparticularerrorcode



GetStatement



Retrievesdatafromadiskfileintoaprogramvariable;replacedby

theFileGetfunction



GoSub...Return

Statement



Passesexecutionto,andreturnsfrom,ablocksubroutinewithina

procedure



ImestatusFunction



ReturnsthestateoftheInputMethodEditor,usedforlocalizedor

specializeddatainput



ImpOperator



Representsalogicalimplicationoperator;usetheexpression"(NotA)

OrB"instead



InitializeEvent



Fireswhenanobjectisfirstused;useclassconstructorsinstead



InputB,InputB$

Functions



Readsadesignatednumberofcharactersfromafileopenedininput

orbinarymode



InstancingProperty Defineshowinstancesofaclassarecreated;specifyinstancinginthe

classconstructorinstead

InStrBFunction



Returnsthepositionofaparticularbyteinabinarystring



IsEmptyFunction



Determinesifavariablehasbeeninitialized;replacedbytheIsNothing

function



IsMissingFunction



Determineswhetheranargumenthasbeenpassedtoaprocedure



IsnullFunction



IndicateswhetheranexpressioncontainsNulldata;replacedbythe

IsDbNullfunction



IsObjectFunction



Indicateswhetheravariablecontainsareferencetoanobject;

replacedbytheIsReferencefunction



LeftB,LeftB$

Functions



Returnstheleftmostspecifiednumberofbytesofbinarydata



LenBFunction



Returnstheactualsizeofauser-definedtypeinmemory



LetStatement



Assignsthevalueofanexpressiontoavariable;simplyassignvalues

withouttheLetkeyword



LineInput#

Statement



Retrievesasinglelinefromaninputfileintoavariable;replacedby

theLineInputfunction



LineMethod



Drawslinesorboxesonaform,PictureBoxcontrol,orotherdrawing

surface;replacedbyfeaturesintheSystem.Drawingnamespace



LoadStatement



Loadsaformorcontrolintomemoryforuse



LoadResData

Function



Extractsastringcontainingaresourceincludedinaresourceproject;

inVisualBasic2005,usetheMy.Resourcesobject



LoadResPicture

Function



AssignsagraphicfromaresourcefiletothePicturepropertyofan

object;inVisualBasic2005,usetheMy.Resourcesobject



LoadResString

Function



Retrievesastringfromaresourcefile;inVisualBasic2005,usethe

My.Resourcesobject



MidB,MidB$

Functions



Returnsaspecifiednumberofbytesfromalargerbinarystring



MidBStatement



Replacesaspecifiednumberofbytesinabinarystring



MTSTransactionMode IndicateswhetheracomponentisanMTSobjectand,ifso,

Property

determinesitsleveloftransactionsupport

NameStatement



Renamesadiskfileordirectory;replacedbytheRenamefunction



NullKeyword



IndicatesaNulldatavalue;usetheDBNullclassintheSystem

namespace



ObjPtrFunction



Returnsapointertoanobject



On...GoSub

Statement



Causesprogramexecutiontojumptoablocksubroutinebasedonthe

valueofacontrolvariable



On...GotoStatement Causesprogramexecutiontojumptoalabelbasedonthevalueofa

controlvariable

OpenStatement



Opensafile;replacedbytheFileOpenfunction



OptionBase

Statement



Definesthedefaultlowerboundforarraysdimensionedwithina

module;allarraysnowhavealowerboundof0



OptionPrivate

ModuleStatement



Restrictsthescopeandvisibilityofamoduletothemodule'sproject;

useaccessmodifiersineachModulestatement



PersistableProperty DetermineswhetheraclassinanActiveXDLLprojectcanbesavedto

disk

PropertyStatement Declaresproceduresforreadandwritesupportofclassproperty

values;replacedwithanupdatedPropertystatementsyntax

PSetMethod



Drawsacoloredpointonaform,PictureBoxcontrol,orotherdrawing

surface;replacedbyfeaturesintheSystem.Drawingnamespace



PutStatement



Writesdatafromaprogramvariabletoadiskfile;replacedbythe



FilePutfunction



RightB,RightB$

Functions



Returnstherightmostbytesfromabinarystring



ScaleMethod



Definesacustomcoordinatesystemonaform,PictureBoxcontrol,or

otherdrawingsurface;replacedbyfeaturesintheSystem.Drawing

namespace



SetStatement



Assignsanobjectreferencetoavariable;simplyassignobjects

withouttheSetkeyword



SgnFunction



Determinesthesignofanumber;replacedbytheSignmethodinthe

System.Mathclass



SqrFunction



Calculatesthesquarerootofanumber;replacedbytheSqrtmethod

intheSystem.Mathclass



StringFunction



Createsastringcomposedofasinglecharacterrepeatedagiven

numberoftimes;replacedbyspecialconstructorsontheStringdata

type



StrPtrFunction



ReturnsapointertoaBSTR(VisualBasicstring)



TerminateEvent



Fireswhenanobjectisdestroyed;usetheDisposeandFinalize

methodsofaclassinstead



TimeFunction



Returnsthecurrentsystemtime;replacedbythe

DateTime.TimeOfDayproperty



TimeStatement



Setsthecurrentsystemtime;replacedbytheDateTime.TimeOfDay

property



TypeStatement



Definesauser-definedtype;replacedbytheStructurestatement(or

eventheClassstatement)



UnloadStatement



Removesaformoradynamicallycreatedmemberofacontrolarray

frommemory



VariantDataType



Genericdatatype;usetheObjectorotherrelevantdatatypeinstead



VarPtrFunction



Returnsapointertoavariable



WendKeyword



TerminatesaWhileloopblock;replacedbytheEndWhilekeywordpair



Width#Statement



Specifiesavirtualfilewidthwhenworkingwithfilesopenedwiththe

Openstatement







AppendixH.TheVisualBasicCommandLineCompiler

AlthoughtheVisualStudioIntegratedDevelopment

Environment(IDE)isanefficienttoolfordevelopingyourVB

applications,youcanactuallydoallofyourdevelopmentin

Notepad(a.k.a."VisualNotepad")andcompilethesourcecode

fromtheWindowscommandprompt.Thisappendixdetailsthe

operationoftheVisualBasiccompiler,vbc.exe.







H.1.CompilerBasics

Thecompilerusescommand-lineswitchestocontrolits

operation.Acommand-lineswitchisdesignatedbyaslashor

hyphen,followedbyakeyword.Ifthekeywordtakesan

argument,itisseparatedfromthekeywordbyacolon(:).For

example:

vbcsample1.vb/target:library



indicatesthatthecompilershouldgeneratealibrary(aDLLfile)

astheoutputtargetfiletype.Inthiscase,targetistheswitch

keywordandlibraryistheargument.Ifmultipleargumentsare

required,theyareusuallyseparatedfromoneanotherby

commas(unlessotherwisenoted).Forexample:

vbcsample1.vb/r:system.design.dll,system.messaging.dll



referencesthemetadatainthesystem.design.dlland

system.messaging.dllassemblies.

Theminimalsyntaxrequiredtocompileafilenamed

sample1.vbis:

vbcsample1.vb



Thisgeneratesaconsole-modeapplicationnamedsample1.exe.

Youcanspecifythetypeofcomponentorapplicationyouwish

togeneratebyusingthe/target(or/t)switch.Togeneratea

Windowsexecutable,youentersomethinglikethefollowingat



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Appendix G.  VB 6 Language Elements No Longer Supported

Tải bản đầy đủ ngay(0 tr)

×