При написание скрипта для l2phx возник один вопрос. Задача такая: имеется текст в масиве(или переменной), требуется разбить данный текст на куски(т.к имеется предел на передаваемый текст в чат)
Делаю следуещее:
Код:
var
bykv, bykv2: Integer;
text, text1: string;
jokes: array [1..x] of string;
........
bykv := length(jokes[i]);
if (bykv>100) then
begin
text := jokes[i];
for bykv2 := 0 to 100 do
begin
text1[bykv2] := text[bykv2];
end
end;
При выполнение данного куска кода происходит ошибка: Access violation at address 0054E3AD in module 'l2pbx.exe'. Write of address FFFFFFFF.
Код:
Exception class: EAccessViolation
Exception message: Access violation at address 0054E3AD in module 'l2pbx.exe'. Write of address FFFFFFFF.
Exception address: 0054E3AD
------------------------------------------------------------------------------
Stack list, generated 09.12.2008 17:16:22
(0014D3AD){l2pbx.exe } [0054E3AD] fs_iinterpreter.TfsStringDesignator.SetValue (Line 1902, "fs_iinterpreter.pas" + 1) + $36
(0014E88C){l2pbx.exe } [0054F88C] fs_iinterpreter.TfsAssignmentStmt.Execute (Line 2666, "fs_iinterpreter.pas" + 3) + $13
(0014E79D){l2pbx.exe } [0054F79D] fs_iinterpreter.TfsStatement.Execute (Line 2630, "fs_iinterpreter.pas" + 4) + $B
(0014EFC1){l2pbx.exe } [0054FFC1] fs_iinterpreter.TfsForStmt.Execute (Line 2825, "fs_iinterpreter.pas" + 18) + $2
(0014E79D){l2pbx.exe } [0054F79D] fs_iinterpreter.TfsStatement.Execute (Line 2630, "fs_iinterpreter.pas" + 4) + $B
(0014ED2A){l2pbx.exe } [0054FD2A] fs_iinterpreter.TfsIfStmt.Execute (Line 2743, "fs_iinterpreter.pas" + 4) + $2
(0014E79D){l2pbx.exe } [0054F79D] fs_iinterpreter.TfsStatement.Execute (Line 2630, "fs_iinterpreter.pas" + 4) + $B
(0014B59C){l2pbx.exe } [0054C59C] fs_iinterpreter.TfsProcVariable.GetValue (Line 1067, "fs_iinterpreter.pas" + 27) + $B
(0001C4D5){l2pbx.exe } [0041D4D5] Variants.VarIsArray (Line 4442, "sys\variants.pas" + 2) + $6
(0014E3CE){l2pbx.exe } [0054F3CE] fs_iinterpreter.TfsScript.CallFunction (Line 2418, "fs_iinterpreter.pas" + 9) + $7
(00170DAF){l2pbx.exe } [00571DAF] main.TL2PacketHackMain.ScriptsListClickCheck (Line 3518, "main.pas" + 16) + $34
(0015A331){l2pbx.exe } [0055B331] CheckLst.TCheckListBox.ClickCheck (Line 543, "CheckLst.pas" + 1) + $14
(0015A312){l2pbx.exe } [0055B312] CheckLst.TCheckListBox.ToggleClickCheck (Line 537, "CheckLst.pas" + 11) + $6
(0015A268){l2pbx.exe } [0055B268] CheckLst.TCheckListBox.MouseDown (Line 512, "CheckLst.pas" + 9) + $5
(0006E9C2){l2pbx.exe } [0046F9C2] Controls.TControl.DoMouseDown (Line 5252, "Controls.pas" + 7) + $20
(0006EA10){l2pbx.exe } [0046FA10] Controls.TControl.WMLButtonDown (Line 5261, "Controls.pas" + 5) + $E
(0004BC0C){l2pbx.exe } [0044CC0C] StdCtrls.TCustomListBox.WMLButtonDown (Line 4811, "StdCtrls.pas" + 14) + $4
(00071B1D){l2pbx.exe } [00472B1D] Controls.TWinControl.MainWndProc (Line 7076, "Controls.pas" + 6) + $0
(0006E3E7){l2pbx.exe } [0046F3E7] Controls.TControl.WndProc (Line 5146, "Controls.pas" + 83) + $6
(0002E91C){l2pbx.exe } [0042F91C] Classes.StdWndProc (Line 11583, "common\Classes.pas" + 8) + $0
(000723DF){l2pbx.exe } [004733DF] Controls.TWinControl.WndProc (Line 7304, "Controls.pas" + 111) + $6
(00085CD7){l2pbx.exe } [00486CD7] Forms.TCustomForm.WndProc (Line 3512, "Forms.pas" + 136) + $5
(00023AAC){l2pbx.exe } [00424AAC] Classes.TThreadList.UnlockList (Line 3359, "common\Classes.pas" + 0) + $4
(0003A330){l2pbx.exe } [0043B330] Graphics.FreeMemoryContexts (Line 5060, "Graphics.pas" + 12) + $5
(00071E90){l2pbx.exe } [00472E90] Controls.TWinControl.IsControlMouseMsg (Line 7176, "Controls.pas" + 9) + $25
(0002E91C){l2pbx.exe } [0042F91C] Classes.StdWndProc (Line 11583, "common\Classes.pas" + 8) + $0
(000723DF){l2pbx.exe } [004733DF] Controls.TWinControl.WndProc (Line 7304, "Controls.pas" + 111) + $6
(0004BB83){l2pbx.exe } [0044CB83] StdCtrls.TCustomListBox.WndProc (Line 4790, "StdCtrls.pas" + 43) + $6
(00071B08){l2pbx.exe } [00472B08] Controls.TWinControl.MainWndProc (Line 7073, "Controls.pas" + 3) + $6
(0002E91C){l2pbx.exe } [0042F91C] Classes.StdWndProc (Line 11583, "common\Classes.pas" + 8) + $0
(0006979A){l2pbx.exe } [0046A79A] Controls.FindControl (Line 2104, "Controls.pas" + 6) + $9
(0008DB0C){l2pbx.exe } [0048EB0C] Forms.TApplication.ProcessMessage (Line 8105, "Forms.pas" + 23) + $1
(0008DB46){l2pbx.exe } [0048EB46] Forms.TApplication.HandleMessage (Line 8124, "Forms.pas" + 1) + $4
(0008DE3B){l2pbx.exe } [0048EE3B] Forms.TApplication.Run (Line 8223, "Forms.pas" + 20) + $3
(00178BA7){l2pbx.exe } [00579BA7] l2pbx.l2pbx (Line 25, "" + 4) + $7
------------------------------------------------------------------------------
System : Windows Vista Professional, Version: 6.0, Build: 1771, "Service Pack 1"
Processor: Intel, Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz, 3166 MHz MMX 64 bits DEP
Memory: 4093; free 2542
Display : 1280x1024 pixels, 32 bpp
------------------------------------------------------------------------------
List of loaded modules:
[00400000] D:\BOTS\l2phx.3.4.1.61\l2pbx.exe
3.4.1.59 - 3.4.1.59
[02C90000] J:\Windows\system32\Amhooker.dll
<10000000> (no version info)
[10000000] J:\Windows\system32\PrxerDrv.dll
2.70.0.1 - 2, 70, 0, 1
ProxifierDrv
[6D710000] J:\PROGRA~2\KASPER~1\KASPER~1\mzvkbd.dll
8.0.0.454 - 8.0.0.454
Mozilla 2 Virtual Keyboard
[6D730000] J:\PROGRA~2\KASPER~1\KASPER~1\mzvkbd3.dll
8.0.0.454 - 8.0.0.454
Mozilla 3 Virtual Keyboard
[711C0000] J:\Windows\system32\olepro32.dll
6.0.6001.18000 - 6.0.6001.18000
[720A0000] J:\Windows\system32\oledlg.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Поддержка интерфейса пользователя OLE
[722E0000] J:\Windows\system32\RICHED20.DLL
5.31.23.1228 - 5.31.23.1228
Rich Text Edit Control, v3.1
[725C0000] J:\Windows\system32\msi.dll
4.0.6001.18000 - 4.0.6001.18000
Windows Installer
[729C0000] J:\Windows\SysWOW64\SFC.DLL
6.0.6000.16386 - 6.0.6000.16386 (vista_rtm.061101-2205)
Windows File Protection
[729D0000] J:\Windows\system32\sfc_os.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Windows File Protection
[740E0000] J:\Windows\system32\winspool.drv
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Драйвер диспетчера очереди Windows
[74380000] J:\Windows\system32\mpr.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Библиотека маршрутизации для нескольких служб доступа
[744C0000] J:\Windows\system32\version.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Version Checking and File Installation Libraries
[744F0000] J:\Windows\system32\mswsock.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Расширение поставщика службы API Microsoft Windows Sockets 2.0
[74530000] J:\Windows\system32\DWMAPI.DLL
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Microsoft Desktop Window Manager API
[74550000] J:\Windows\System32\wshtcpip.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Библиотека DLL помощника службы Winsock2 (TL/IPv4)
[74560000] J:\Windows\system32\msiltcfg.dll
4.0.6000.16386 - 4.0.6000.16386 (vista_rtm.061101-2205)
Windows Installer Configuration API Stub
[74570000] J:\Windows\system32\wsock32.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Windows Socket 32-Bit DLL
[745B0000] J:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll
6.10.6001.18000 - 6.10 (vista_rtm.061101-2205)
Библиотека элементов управления взаимодействия с пользователем
[74D00000] J:\Windows\system32\uxtheme.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Библиотека тем UxTheme (Microsoft)
[75160000] J:\Windows\syswow64\Secur32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Security Support Provider Interface
[751C0000] J:\Windows\syswow64\MSCTF.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Серверная библиотека MSCTF
[75320000] J:\Windows\syswow64\GDI32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
GDI Client DLL
[753B0000] J:\Windows\syswow64\Normaliz.dll
6.0.6000.16386 - 6.0.6000.16386 (vista_rtm.061101-2205)
Unicode Normalization DLL
[753C0000] J:\Windows\syswow64\oleaut32.dll
6.0.6001.18000 - 6.0.6001.18000
[75580000] J:\Windows\system32\IMM32.DLL
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Multi-User Windows IMM32 API Client DLL
[755E0000] J:\Windows\syswow64\iertutil.dll
7.0.6001.18000 - 7.00.6001.18000 (longhorn_rtm.080118-1840)
Run time utility for Internet Explorer
[75630000] J:\Windows\syswow64\PSAPI.DLL
6.0.6000.16386 - 6.0.6000.16386 (vista_rtm.061101-2205)
Process Status Helper
[75640000] J:\Windows\syswow64\wininet.dll
7.0.6001.18000 - 7.00.6000.16386 (vista_rtm.061101-2205)
Расширения Интернета для Win32
[75710000] J:\Windows\syswow64\WS2_32.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
32-разрядная библиотека Windows Socket 2.0
[75740000] J:\Windows\syswow64\RPCRT4.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Библиотека удаленного вызова процедур
[75830000] J:\Windows\syswow64\SETUPAPI.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Windows Setup API
[759C0000] J:\Windows\syswow64\NSI.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
NSI User-mode interface DLL
[759D0000] J:\Windows\syswow64\kernel32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Библиотека клиента Windows NT BASE API
[75AE0000] J:\Windows\syswow64\ole32.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Microsoft OLE для Windows
[75C80000] J:\Windows\syswow64\SHLWAPI.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Библиотека небольших программ оболочки
[75CE0000] J:\Windows\syswow64\LPK.DLL
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Language Pack
[75CF0000] J:\Windows\syswow64\USER32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Многопользовательская библиотека клиента USER API Windows
[75DF0000] J:\Windows\syswow64\comdlg32.dll
6.0.6001.18000 - 6.0.6000.16386 (vista_rtm.061101-2205)
Библиотека общих диалоговых окон
[75E70000] J:\Windows\syswow64\ADVAPI32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Расширенная библиотека API Windows 32
[75F40000] J:\Windows\syswow64\shell32.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Общая библиотека оболочки Windows
[76A50000] J:\Windows\syswow64\USP10.dll
1.626.6001.18000 - 1.0626.6001.18000 (longhorn_rtm.080118-1840)
Uniscribe Unicode script processor
[76AD0000] J:\Windows\syswow64\CLBCatQ.DLL
2001.12.6931.18000 - 2001.12.6931.18000 (longhorn_rtm.080118-1840)
COM+ Configuration Catalog
[76B60000] J:\Windows\syswow64\msvcrt.dll
7.0.6001.18000 - 7.0.6001.18000 (longhorn_rtm.080118-1840)
Windows NT CRT DLL
[76FB0000] J:\Windows\SysWOW64\ntdll.dll
6.0.6001.18000 - 6.0.6001.18000 (longhorn_rtm.080118-1840)
Системная библиотека NT
------------------------------------------------------------------------------
Active Controls hierarchy:
TCheckListBox "ScriptsList"
TGroupBox "GroupBox3"
TPanel "Panel19"
TTabSheet "TabSheet6"
TPageControl "PageControl1"
TL2PacketHackMain "L2PacketHackMain"
------------------------------------------------------------------------------
В чём может быть причина? Пробывал на разных версиях l2phx, тоже самое.
Количество символов определяется верно. Подазреваю что во всём виновата строка: text1[bykv2] := text[bykv2];.
Синтаксис обращения к одному символу строки.
Но что в ней не так?