资源预览内容
第1页 / 共64页
第2页 / 共64页
第3页 / 共64页
第4页 / 共64页
第5页 / 共64页
第6页 / 共64页
第7页 / 共64页
第8页 / 共64页
第9页 / 共64页
第10页 / 共64页
亲,该文档总共64页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
1 2 MicrosoftVisualBasic NET Reloaded Objectives IncludetheselectionstructureinpseudocodeandinaflowchartWriteanIf Then ElsestatementWritecodethatusescomparisonoperatorsandlogicaloperatorsCreateavariablehavingblockscopeUsethelinecontinuationcharacter 3 MicrosoftVisualBasic NET Reloaded Objectives continued ConcatenatestringsUsetheControlCharsNewLineconstantChangethecaseofastringDeterminewhetheranexpressioncanbeconvertedtoanumberDisplayamessageinamessagebox 4 MicrosoftVisualBasic NET Reloaded Objectives continued Includeanestedselectionstructureinpseudocode flowchart andcodeCodeanIf Elseif ElseselectionstructureIncludeaCaseselectionstructureinpseudocode flowchartandcode 5 MicrosoftVisualBasic NET Reloaded TheSelectionStructure AlsocalleddecisionstructureMakeacomparisonandchoosebetween2pathsdependingupontheresultofcomparison condition 6 MicrosoftVisualBasic NET Reloaded WritingPseudocodefortheIfandIf ElseSelectionStructures Ifselectionstructure 1setofinstructionswhichareprocessedifconditionistrueIf Else 2setsofinstructions thefirstwhenconditionistrue theotherwhenconditionisfalse 7 MicrosoftVisualBasic NET Reloaded FlowchartingtheIfandIf ElseSelectionStructures 8 MicrosoftVisualBasic NET Reloaded CodingtheIfandIf ElseSelectionStructures 9 MicrosoftVisualBasic NET Reloaded CodingtheIfandIf ElseSelectionStructures continued StatementBlockSetofinstructionsin true path betweenkeywordsIfandThen Optionalsetofinstructionsin false path betweenkeywordsThenandEndIf Anyitemsinsquarebracketsareoptional 10 MicrosoftVisualBasic NET Reloaded ComparisonOperators Alsoreferredtoasrelationaloperators 11 MicrosoftVisualBasic NET Reloaded ComparisonOperators continued 12 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example1 13 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example1 continued Note variableintTemphasblockscopeandcanonlybeusedinblockinwhichdeclared 14 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example1 continued 15 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example1 continued LinecontinuationcharacterSpacefollowedbyanunderscoreUsedtobreakuplonginstructionsonto2linesConcatenationOperatorTheampersand Usedtoconcatenate connectorlink strings 16 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example1 continued 17 MicrosoftVisualBasic NET Reloaded HOWTO 18 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example2 19 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example2 continued 20 MicrosoftVisualBasic NET Reloaded UsingComparisonOperators Example2 continued 21 MicrosoftVisualBasic NET Reloaded UsingtheToUpperandToLowerMethods 22 MicrosoftVisualBasic NET Reloaded UsingtheToUpperandToLowerMethods continued 23 MicrosoftVisualBasic NET Reloaded UsingtheToUpperandToLowerMethods continued 24 MicrosoftVisualBasic NET Reloaded LogicalOperators 25 MicrosoftVisualBasic NET Reloaded LogicalOperators continued 26 MicrosoftVisualBasic NET Reloaded TruthTables 27 MicrosoftVisualBasic NET Reloaded TruthTables continued Note short circuitevaluationcanoccurwith And operator Bothconditionswillnotbetestediffirstconditiontestsfalse 28 MicrosoftVisualBasic NET Reloaded UsingtheTruthTables Understandingorderofprecedenceiscritical 29 MicrosoftVisualBasic NET Reloaded UsingtheTruthTables continued 30 MicrosoftVisualBasic NET Reloaded UsingLogicalOperatorsinanIf Then ElseStatement 31 MicrosoftVisualBasic NET Reloaded ModifyingtheSkate AwaySalesApplication 32 MicrosoftVisualBasic NET Reloaded ModifyingtheSkate AwaySalesApplication continued Modifytoeliminateunwantederrormessage 33 MicrosoftVisualBasic NET Reloaded ModifyingtheSkate AwaySalesApplication continued 34 MicrosoftVisualBasic NET Reloaded TheIsNumericFunction Function ApredefinedprocedurethatperformsaspecifictaskandreturnsavalueaftercompletingthetaskIsNumericfunctionchecksifanexpressioncanbeconvertedtoanumberReturnsBooleantrueifabletoconverttonumberReturnsBooleanfalseifconversioncantbemade 35 MicrosoftVisualBasic NET Reloaded TheIsNumericFunction continued 36 MicrosoftVisualBasic NET Reloaded TheMessageBox Showmethod 37 MicrosoftVisualBasic NET Reloaded TheMessageBox Showmethod continued ArgumentsintheMessageBox ShowmethodText astringcontainingthetexttodisplayCaption textdisplayedintitlebarButtons buttonstodisplayinmessageboxCanbeoneof6differentconstantsIcon icondisplayedintitlebarDefaultbutton buttonautomaticallyselectedifuserpressestheEnterkeyonkeyboard 38 MicrosoftVisualBasic NET Reloaded TheMessageBox Showmethod continued 39 MicrosoftVisualBasic NET Reloaded TheMessageBox Showmethod continued 40 MicrosoftVisualBasic NET Reloaded HOWTO 41 MicrosoftVisualBasic NET Reloaded NestedSelectionStructures Whenatleastonesideoftheselectionstructure spathcontainsanotherselectionstructureInnerstructureisreferredtoas nested Else ispairedupwithnearestprecedingIfregardlessofindentationofcodeUsewhenyouwanttomakeonedecisionandthenchoosebetweentwooptionsdependingupontheresultofthefirstdecision 42 MicrosoftVisua
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号