タイトル : Re: 文字列のバイト取得 投稿日 : 2008/03/25(Tue) 18:32 投稿者 : 戸豚
unionとはちょっと違いますが、Typeでデータ構造体を定義して、Lsetで代入すれば似たような処理はできます。 Type WORD_T Value As Integer End Type Type BYTE2_T Binary(1) As Byte End Type Public Function getImage(ByVal lWord As Integer) As Byte() 'Word/__int16(16Bit整数型)のバイトイメージを取得する Dim ret() As Byte Dim wImg As WORD_T Dim bImg As BYTE2_T wImg.Value = lWord LSet bImg = wImg getImage = bImg.Binary End Function |