ab.com コミュニティ https://www.activebasic.com/forum/ |
|
「Input #」文でアクセス違反[ver4.22] https://www.activebasic.com/forum/viewtopic.php?t=813 |
ページ 1 / 1 |
作成者: | 卓漏 [ 2006年3月12日(日) 16:33 ] |
記事の件名: | 「Input #」文でアクセス違反[ver4.22] |
次のようなプログラムを実行したところ・・・・、 コード: Open "data52.txt" For Input As 1 Dim I, Str$ While Eof(1) = 0 I++ Input #1,Str$ Print I Wend Close(1)「data52.txt」(約30KB)のファイルデータは下のような感じで「0」と「,」が、ず~っとつながっているのですが、 コード: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,なぜか、(毎回バラバラですが、)約6000回くらい読み込んだころにエラーがでます。 「string.sbp」に「_System_HeapStringAlloc」という関数がありますが、 [ここをクリックすると内容が表示されます] その「SetDWord(_System_HeapStringAlloc-4,length)」でエラーが発生しているみたいです。
コード: Function _System_HeapStringAlloc(length As DWord) As *Byte _System_HeapStringAlloc=(HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,4+length+1)+4) As *Byte SetDWord(_System_HeapStringAlloc-4,length) EnterCriticalSection(_System_CriticalSection) _System_AllocatedStringInfo.pAddress=(HeapReAlloc(_System_hProcessHeap,0,_System_AllocatedStringInfo.pAddress,(_System_AllocatedStringInfo.num+1)*4)) As *DWord SetDWord(_System_AllocatedStringInfo.pAddress+_System_AllocatedStringInfo.num*SizeOf(DWord),_System_HeapStringAlloc) _System_AllocatedStringInfo.num=_System_AllocatedStringInfo.num+1 LeaveCriticalSection(_System_CriticalSection) End Function |
ページ 1 / 1 | 全ての表示時間は UTC+09:00 です |
Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |