public const VsAltKeyMask01 = &H8000
public const VsAltKeyMask02 = &H4000
public const VsAltKeyMask03 = &H2000
public const VsAltKeyMask04 = &H1000
public const VsAltKeyMask05 = &H800
public const VsAltKeyMask06 = &H400
public const VsAltKeyMask07 = &H200
public const VsAltKeyMask08 = &H100
public const VsAltKeyMask09 = &H80
public const VsAltKeyMask10 = &H40
public const VsAltKeyMask11 = &H20
public const VsAltKeyMask12 = &H10
public const VsAltKeyMask13 = &H8
public const VsAltKeyMask14 = &H4
public const VsAltKeyMask15 = &H2
public const VsAltKeyMask16 = &H1
public const VsPriKey = 0
dim keybitmap as integer;
keybitmap = VsPriKey + VsAltKeyMask1
이하생략
//델파이
const VsAltKeyMask01 = $8000;
const VsAltKeyMask02 = $4000;
const VsAltKeyMask03 = $2000;
이하 생략 ...
으로 변환 했는데.
var
keybitmap as Smallint;
keybitmap := VsPriKey + VsAltKeyMask1;
이렇게 하니까
constant expression violates subrange bounds 라는 오류가 발생해요 ..
어케 변환하죠 ?
위의 vb는 16bit변수에서 bit연산을 하는것 같은데.
> public const VsAltKeyMask01 = &H8000
> public const VsAltKeyMask02 = &H4000
> public const VsAltKeyMask03 = &H2000
> public const VsAltKeyMask04 = &H1000
> public const VsAltKeyMask05 = &H800
> public const VsAltKeyMask06 = &H400
> public const VsAltKeyMask07 = &H200
> public const VsAltKeyMask08 = &H100
> public const VsAltKeyMask09 = &H80
> public const VsAltKeyMask10 = &H40
> public const VsAltKeyMask11 = &H20
> public const VsAltKeyMask12 = &H10
> public const VsAltKeyMask13 = &H8
> public const VsAltKeyMask14 = &H4
> public const VsAltKeyMask15 = &H2
> public const VsAltKeyMask16 = &H1
> public const VsPriKey = 0
>
> dim keybitmap as integer;
>
> keybitmap = VsPriKey + VsAltKeyMask1
>
> 이하생략
>
>
> //델파이
> const VsAltKeyMask01 = $8000;
> const VsAltKeyMask02 = $4000;
> const VsAltKeyMask03 = $2000;
> 이하 생략 ...
> 으로 변환 했는데.
>
> var
> keybitmap as Smallint;
>
> keybitmap := VsPriKey + VsAltKeyMask1;
>
> 이렇게 하니까
> constant expression violates subrange bounds 라는 오류가 발생해요 ..
> 어케 변환하죠 ?
> 위의 vb는 16bit변수에서 bit연산을 하는것 같은데.
>
답을 찾았습니다........
대답이 의외로 간단했습니다.
keybitmap := keybitmap or VspriKey or VsAltKeyMask1;