ab.com コミュニティ

ActiveBasicを通したコミュニケーション
現在時刻 - 2024年4月20日(土) 13:23

全ての表示時間は UTC+09:00 です




新しいトピックを投稿する  トピックへ返信する  [ 2 件の記事 ] 
作成者 メッセージ
投稿記事Posted: 2008年7月11日(金) 18:09 
下記のようなことをしてみたのですが、getSingle関数の戻り値が変(0)です。
使い方を間違っているのでしょうか?
Doubleの方は、期待値どおりなんですが。
使っているのは、4.24.00です。

#prompt
dim tmp as single
dim temp as double
dim buf[7] as byte
buf[3]=&hc3:buf[2]=&h28:buf[1]=&hb9:buf[0]=&h6b
buf[7]=&hc3:buf[6]=&h28:buf[5]=&hb9:buf[4]=&h6b

print getSingle(buf)
memcpy(VarPtr(tmp),buf,4)
print tmp

print getDouble(buf)
memcpy(VarPtr(temp),buf,8)
print temp


通報する
ページトップ
   
 記事の件名:
投稿記事Posted: 2008年7月11日(金) 19:39 
オフライン

登録日時: 2005年7月25日(月) 13:27
記事: 893
お住まい: 埼玉県東松山市
バグですね。
次のように回避してください。
コード:
#prompt
dim tmp as single
dim temp as double
dim buf[7] as byte
buf[3]=&hc3:buf[2]=&h28:buf[1]=&hb9:buf[0]=&h6b
buf[7]=&hc3:buf[6]=&h28:buf[5]=&hb9:buf[4]=&h6b

print getSingle2(buf)
memcpy(VarPtr(tmp),buf,4)
print tmp

print getDouble(buf)
memcpy(VarPtr(temp),buf,8)
print temp

Function getSingle2(lpSingle As VoidPtr) As Single
	SetDWord(VarPtr(getSingle2),GetDWord(lpSingle))
End Function

_________________
Website→http://web1.nazca.co.jp/himajinn13sei/top.html
ここ以外の場所では「暇人13世」というHNを主として使用。

に署名を書き換えて欲しいと言われたので暇だしやってみるテスト。


通報する
ページトップ
期間内表示:  ソート  
新しいトピックを投稿する  トピックへ返信する  [ 2 件の記事 ] 

全ての表示時間は UTC+09:00 です


オンラインデータ

このフォーラムを閲覧中のユーザー: Bing [Bot] & ゲスト[21人]


トピック投稿:  可
返信投稿:  可
記事編集: 不可
記事削除: 不可
ファイル添付: 不可

検索:
ページ移動:  
Powered by phpBB® Forum Software © phpBB Limited
Japanese translation principally by ocean