질문이용ㅎㅎ
FaintTears
2023.04.01
Module Module1 Class Some Public Shared Sub PrintMessage(Optional ByVal m As String = 디폴트 메시지, Optional ByVal n As Integer = 3, Optional ByVal bBeep As Boolean = True) Dim i As Integer For i = 1 To n MsgBox(m) Next If bBeep Then Console.Beep() End If End Sub End Class
Sub Main() Some.PrintMessage(메시지, 2, False) Some.PrintMessage(다른 메시지, 1) Some.PrintMessage(이 메시지는 세 번 출력됨) Some.PrintMessage() End SubEnd Module
VB.NET에서도 c언어와 마찬가지로 Sub Main() 이 부분이 먼저 실행되나요?그리고 If bBeep ThenConsole.Beep()End If이부분에서 Console.Beep()대신에 MsgBox를 사용해서 바꾸는법좀 알려주세요