[컴퓨터 공학]스택 비주얼베이직으로 만듬
- 최초 등록일
- 2006.05.21
- 최종 저작일
- 2006.04
- 2페이지/ 압축파일
- 가격 1,000원
소개글
비주얼 베이직으로 스택 구현했습니다..
팝,푸쉬,리셋,크리에이트,종료
에러없이 잘 됩니다...
제가 정성껏 만들었고요 초보자분들도 소스보면
금방 이해가실겁니다..^^
컴파일 실행환경
없음
본문내용
Dim icount As Integer, defaulti As Integer, ipush As Integer, pcount As Integer, defaultj As Integer
Private Sub Command1_Click() `push 버튼
Dim i As Integer
If ipush <= Label1.ubound Then `ipush가 컨트롤의 가장 큰 서수값보다 작거나 같으면
Label1(icount).Caption = ipush ` label1에 push를 누를때마다 값을 뿌려주는 역할
ipush = ipush + 1
icount = icount + 1
Else ` 레이블배열값보다 많이 입력되면 뜨는경고창
MsgBox "더이상 입력할 수 없습니다", vbInformation
End If
End Sub
Private Sub Command2_Click() `pop버튼
pcount = pcount + 1
ipush = ipush - 1
If pcount > Label2.ubound Then `pop data창이 꽉차면 처음부터 다시 레이블1번으로가는 역할
pcount = 1
End If
If ipush >= 1 Then
Label2(pcount).Caption = Label1(icount - 1).Caption
Label1(icount - 1) = ""
icount = icount - 1
ElseIf icount <= 1 Then ` push data창이 empty면 뜨는 경고창
MsgBox "Push Data가 비었습니다.", vbInformation
ipush = 1
End If
End Sub
Private Sub Command3_Click() `reset버튼
Dim i As Integer
For i = 1 To Label1.ubound `레이블의 1번부터 생성된마지막까지
Label1(i).Caption = "" `레이블의 데이터를 지우는 역할
Label2(i).Caption = ""
icount = 1
pcount = 0
ipush = 1
Next i
End Sub
Private Sub Command4_Click() `create버튼
Form2.Show `create를 위해 form2생성
End Sub
압축파일 내 파일목록
mystack/
mystack/Form2.frm
mystack/Module1.bas
mystack/MSSCCPRJ.SCC
mystack/mystack.frm
mystack/Project1.exe
mystack/Project1.vbp
mystack/Project1.vbw
참고 자료
없음