Hi
I've posted this under the heading 'Splitting Strings' but when it caused an access violation, that's different so I'm opening this new topic. OS is Vista Home Basic on a Celeron D with 512Mb RAM.
-----------------------------------------------------------------
---------- wme 1.8.006 crash report: 23-08-2008, 11:39 ----------
-----------------------------------------------------------------
wme.exe caused a EXCEPTION_ACCESS_VIOLATION in module wme.exe at 001B:0043FE88, CBGame::IsDirectXBound()+39000 byte(s)
EAX=00000007 EBX=0B9F480F ECX=00000000 EDX=00000000 ESI=00000000
EDI=00000000 EBP=00C5DDE8 ESP=0012FD48 EIP=0043FE88 FLG=00210202
CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
Stack trace:
001B:0043FE88 (0x00C5DDE8 0x00000000 0x00C51358 0x00000000) wme.exe, CBGame::IsDirectXBound()+39000 byte(s)
001B:00C51401 (0x00000000 0x00C51358 0x00000000 0x00000000) <UNKNOWN>
001B:00C5DDE8 (0x00C51358 0x00000000 0x00000000 0x00000000) <UNKNOWN>
Script running at the time was as below - compiles OK, the only thing changed to cause the violation was the addition of the global object 'Noel'
function SetState()
{
BtnDown.
Disabled =
(ScrollOffset+NumSlotButtons > LastUsedSlot
);
for(var i=0; i<NumSlotButtons; i=i+1)
{
var SaveSlot = LastUsedSlot - ScrollOffset - i;
//var SlotButton = this.GetControl(i+1);
SlotButton.
Pressed =
(SaveSlot==
(LastUsedSlot-SelectedSlot
));
SlotButton.
Text = SaveSlot;
{
// Noel's date manuipulation code
var SlotDate;
global Noel;
Noel.l = l;
Noel.StringSplit = StringSplit;
if(l > 16)
{
SlotDate
[i
] = StringSplit.
Substr(0,
16);
Game.
Msg("i is:"+i+
" SlotDate is:"+SlotDate
[i
]);
}
else
{
}
//
// SlotButton.Text = Game.GetSaveSlotDescription(SaveSlot);
}
else
{
}
}
var SelSlot = LastUsedSlot - SelectedSlot;
//
//
{
Thumbnail.
SetImage("savegame:" + SelSlot
);
//
t.
Text = SlotDate
[SelectedSlot -
1];
//
}
else
{
//
//
}
}