「Vle-read-int8-be」の版間の差分

提供:GizmoLabs - だいたい CAD LISP なサイト
(ページの作成:「{{BCAD_LISP}} ; 構文 : (vle-read-int8be ''fptr'') ; 機能 : ファイルから「符号付き整数8ビット」を読み込む(C++の「char / int8」型と同じ…」)
 
編集の要約なし
 
(同じ利用者による、間の3版が非表示)
1行目: 1行目:
{{BCAD_LISP}}
{{BCAD_LISP}}
; 構文
; 構文
: (vle-read-int8be ''fptr'')
: (vle-read-int8-be ''fptr'')




; 機能
; 機能
: ファイルから「符号付き整数8ビット」を読み込む(C++の「char / int8」型と同じ)。
: ファイルから「符号付き整数8ビット」を読み込む(C++の「char / int8」型と同じ)。
; 8ビット値の場合,リトルエンディアンとビッグエンディアンは同一であるため,この関数は完全性のためにのみ提供される。
: 8ビット値の場合,リトルエンディアンとビッグエンディアンは同一であるため,この関数は完全性のためにのみ提供される。




21行目: 21行目:
; テキストで 012 を書き出す
; テキストで 012 を書き出す
(setq fptr (open "c:\\temp\\bwtest.txt" "wb"))
(setq fptr (open "c:\\temp\\bwtest.txt" "wb"))
(vle-write-int8 fptrbe 48)
(vle-write-int8-be fptrbe 48)
(vle-write-int8 fptrbe 49)
(vle-write-int8-be fptrbe 49)
(vle-write-int8 fptrbe 50)
(vle-write-int8-be fptrbe 50)
(close fptr)
(close fptr)
(setq fptr (open "c:\\temp\\bwtest.txt" "rb"))
(setq fptr (open "c:\\temp\\bwtest.txt" "rb"))
(setq str "")
(setq str "")
(while (setq b (vle-read-int8be fptr))
(while (setq b (vle-read-int8-be fptr))
   (setq str (strcat str (chr b)))
   (setq str (strcat str (chr b)))
)
)
43行目: 43行目:
* [[vle-write-int8]]
* [[vle-write-int8]]
* [[vle-read-int8]]
* [[vle-read-int8]]
* [[vle-write-int8be]]
* [[vle-write-int8-be]]
* [[vle-read-int8be]]
* [[vle-read-int8-be]]


[[Category:AutoLISP]]
[[Category:AutoLISP]]
[[Category:BricsCADのLISP]]

2023年1月28日 (土) 08:12時点における最新版

構文
(vle-read-int8-be fptr)


機能
ファイルから「符号付き整数8ビット」を読み込む(C++の「char / int8」型と同じ)。
8ビット値の場合,リトルエンディアンとビッグエンディアンは同一であるため,この関数は完全性のためにのみ提供される。


引数
  • fptr: (open <filename> "rb") で開いたファイルディスクリプタ


戻り値
読み込んだデータの8ビット値


サンプル
; テキストで 012 を書き出す
(setq fptr (open "c:\\temp\\bwtest.txt" "wb"))
(vle-write-int8-be fptrbe 48)
(vle-write-int8-be fptrbe 49)
(vle-write-int8-be fptrbe 50)
(close fptr)
(setq fptr (open "c:\\temp\\bwtest.txt" "rb"))
(setq str "")
(while (setq b (vle-read-int8-be fptr))
  (setq str (strcat str (chr b)))
)
(close fptr)
!str
012


関連事項