forked from yas78/QRCodeLibVBA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactory.bas
More file actions
24 lines (18 loc) · 958 Bytes
/
Factory.bas
File metadata and controls
24 lines (18 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Attribute VB_Name = "Factory"
Option Explicit
Public Function CreateSymbols( _
Optional ByVal ecLevel As ErrorCorrectionLevel = ErrorCorrectionLevel.m, _
Optional ByVal maxVer As Long = Constants.MAX_VERSION, _
Optional ByVal allowStructuredAppend As Boolean = False, _
Optional ByVal charsetName As String = Charset.SHIFT_JIS, _
Optional ByVal fixedSize As Boolean = False) As Symbols
If Not (ErrorCorrectionLevel.l <= ecLevel And ecLevel <= ErrorCorrectionLevel.H) Then Call Err.Raise(5)
If Not (Constants.MIN_VERSION <= maxVer And maxVer <= Constants.MAX_VERSION) Then Call Err.Raise(5)
Dim charEncoding As New Encoding
Call charEncoding.Init(charsetName)
Dim minVer As Long
minVer = IIf(fixedSize, maxVer, Constants.MIN_VERSION)
Dim sbls As New Symbols
Call sbls.Init(ecLevel, minVer, maxVer, allowStructuredAppend, charEncoding)
Set CreateSymbols = sbls
End Function