StrComp Function

๋‘ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•˜๊ณ  ๋น„๊ต ๊ฒฐ๊ณผ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ •์ˆ˜ ๊ฐ’์„ ๋Œ๋ ค ์ค๋‹ˆ๋‹ค.

๊ตฌ๋ฌธ:


StrComp (Text1 As String, Text2 As String[, Compare])

๋ฐ˜ํ™˜ ๊ฐ’:

Integer

๋งค๊ฐœ ๋ณ€์ˆ˜:

Text1: ์ž„์˜์˜ ๋ฌธ์ž์—ด ์‹์ž…๋‹ˆ๋‹ค.

Text2: ์ž„์˜์˜ ๋ฌธ์ž์—ด ์‹์ž…๋‹ˆ๋‹ค.

Compare: ์ด ์„ ํƒ์  ๋งค๊ฐœ ๋ณ€์ˆ˜๋Š” ๋น„๊ต ๋ฐฉ๋ฒ•์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Compare = 1์ผ ๊ฒฝ์šฐ ๋ฌธ์ž์—ด ๋น„๊ต๋Š” ๋Œ€/์†Œ๋ฌธ์ž๋ฅผ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค. Compare = 0์ผ ๊ฒฝ์šฐ ๋Œ€/์†Œ๋ฌธ์ž๋ฅผ ๊ตฌ๋ถ„ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ๊ฐ’

Error codes:

5 ์ž˜๋ชป๋œ ํ”„๋กœ์‹œ์ € ํ˜ธ์ถœ์ž…๋‹ˆ๋‹ค.

์˜ˆ:


Sub ExampleStrComp
Dim iVar As Single
Dim sVar As String
    iVar = 123.123
    sVar = Str$(iVar)
    MsgBox strcomp(sVar , Str$(iVar),1)
End Sub

Please support us!