Declare Statement

LibreOffice Basic์—์„œ ์‹คํ–‰ํ•  ์„œ๋ธŒ๋ฃจํ‹ด์„ DLL ํŒŒ์ผ์—์„œ ์„ ์–ธํ•˜๊ณ  ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

์ฐธ๊ณ  ํ•ญ๋ชฉ: FreeLibrary

๊ตฌ๋ฌธ:


Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type]

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

Name: LibreOffice Basic์—์„œ ์„œ๋ธŒ๋ฃจํ‹ด์„ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•œ ๊ฒƒ์œผ๋กœ, DLL์— ์ง€์ •๋œ ๊ฒƒ๊ณผ๋Š” ๋‹ค๋ฅธ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

Aliasname: DLL์— ์ง€์ •๋œ ์„œ๋ธŒ๋ฃจํ‹ด์˜ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

Libname: DLL์˜ ํŒŒ์ผ ๋˜๋Š” ์‹œ์Šคํ…œ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ํ•จ์ˆ˜๋ฅผ ์ฒ˜์Œ ์‚ฌ์šฉํ•  ๋•Œ ์ž๋™์œผ๋กœ ๋กœ๋“œ๋ฉ๋‹ˆ๋‹ค.

Argumentlist: ํ”„๋กœ์‹œ์ €์— ํ˜ธ์ถœ ์‹œ ์ „๋‹ฌ๋˜๋Š” ์ธ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋งค๊ฐœ ๋ณ€์ˆ˜์˜ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค. ๋งค๊ฐœ ๋ณ€์ˆ˜์˜ ์œ ํ˜•๊ณผ ์ด๋ฆ„์€ ์‹คํ–‰๋˜๋Š” ํ”„๋กœ์‹œ์ €์— ๋”ฐ๋ผ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

Type: ํ•จ์ˆ˜ ํ”„๋กœ์‹œ์ €๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ•˜๋Š” ๊ฐ’์˜ ๋ฐ์ดํ„ฐ ํ˜•์‹์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฆ„ ๋’ค์— ์œ ํ˜• ์„ ์–ธ ๋ฌธ์ž๋ฅผ ์ž…๋ ฅํ•  ๊ฒฝ์šฐ ์ด ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ์ œ์™ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฒฝ๊ณ  ์•„์ด์ฝ˜

๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ์ฐธ์กฐ ๋Œ€์‹  ๊ฐ’์œผ๋กœ ์„œ๋ธŒ๋ฃจํ‹ด์— ์ „๋‹ฌํ•˜๋ ค๋ฉด ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ํ‚ค์›Œ๋“œ ByVal๋กœ ๋‚˜ํƒ€๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.


์˜ˆ:


Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long )
Sub ExampleDeclare
Dim lValue As Long
    lValue = 5000
    MyMessageBeep( lValue )
    FreeLibrary("user32.dll" )
End Sub

Please support us!