LS function replace throws error 232

Hi all,

an error message which I cannot follow:

Dim ToSearch(0) As String

Dim SpaceString(0) As String

Dim CleanLetters As Variant

Dim ret As Variant

SpaceString(0) = " "

ToSearch(0) = " This string is for searching in"

ret = Fulltrim(Replace(ToSearch,CleanLetters,SpaceString))

where Cleanletters is a text array from

CleanLetters = doc.getitemvalue("“Listitem”) and looks like

[0] “.”

[1] “:”

[2] “-”

[3] “[”

[4] “]”

This code runs fine in 8.0.2, but in 6.5.4 it gives me the error:

Error 232: Wrong number of array subscripts.

Thanks in advance for any help :slight_smile:

Uwe

PS: I changed the vars ToSearch and SpaceString into arrays with purpose, because the 8.0.1 client gives an error when using

Replace(string,Array,string).

The 8.0.2 client takes both

Subject: UH! replace causes an NSD in the 6.5.4 client!

I just got an old client - and made a bit more testing:

As soon as I use Variants in the replace function (filled with string arrays), replace crashes my client with an NSD!

Dim a(0) As String

Dim b(0) As String

Dim c(1) As String

Dim ret As Variant

Dim avariant As Variant





a(0) = "aaa"

b(0) = "bbb"

c(0) = "abcde"

c(1) = "aaa"



ret = Replace(c,a,b)	

works ok, but

avariant = a

ret = Replace(c,avariant,b)

crashes the client!

a known error??

uwe

Subject: RE: UH! replace causes an NSD in the 6.5.4 client!

Hi

Can you post the FATAL THREAD section of the NSD files with the few lines under it

For example:

############################################################

FATAL THREAD 1/2 [ domdsm:107a8:67076]

FP=0x0012a34c, PC=0x60069a86, SP=0x0012a2f0, stksize=92

EAX=0x01a3088c, EBX=0x01a48650, ECX=0x0000bffe, EDX=0x01a325e6

ESI=0x00004000, EDI=0x0032ff78, CS=0x0000001b, SS=0x00000023

DS=0x00000023, ES=0x00000023, FS=0x0000003b, GS=0x00000000 Flags=0x00010206

Exception code: c0000005 (ACCESS_VIOLATION)

############################################################

@[ 1] 0x60069a86 nnotes._fdDelete@4+118 (4000,12a368,608770ef,4000)

@[ 2] 0x60069a0c nnotes._OSFileClose@4+12 (4000,12adc0,12a380,60872ea7)

@[ 3] 0x608770ef nnotes._sqloclose+15 (4000,12b59c,5010,0)

@[ 4] 0x60872ea7 nnotes._sqlpgclf+71 (12adc0,1aaa2cb,70,1aaa2f3)

@[ 5] 0x60885458 nnotes._sqlpgfdl+616 (12b9a4,1aaa2cb,41,12be44)

@[ 6] 0x60876a6f nnotes._sqlpgcdl+927 (12bf44,12b9a4,0,12be44).

Date

Topic

Frequently asked question - How to analyze Notes/Domino NSDs? (Jean-Yves Riverin)

Look like this technote

Using the LotusScript ArrayAppend function to append a date time value either appends a blank value or causes a crash

Link

or call IBM support.

JYR

Subject: RE: UH! replace causes an NSD in the 6.5.4 client!

Hi,

here the 2 fatal thread sections:

############################################################

FATAL THREAD 1/12 [ nlnotes:0e58:0c30]

FP=0x0013d7dc, PC=0x6096303a, SP=0x0013d6d4, stksize=264

EAX=0x00000000, EBX=0x00000001, ECX=0x04cec118, EDX=0x00002208

ESI=0x04cec148, EDI=0x00b47288, CS=0x0000001b, SS=0x00000023

DS=0x00000023, ES=0x00000023, FS=0x0000003b, GS=0x00000000 Flags=0x00010206

Exception code: c0000005 (ACCESS_VIOLATION)

############################################################

@[ 1] 0x6096303a nnotes.LScBuiltIn::Replace+138 (4cec138,b47288,13d806,4cebfa8)

@[ 2] 0x600ee602 nnotes.LSsThread::OP_BUILTIN+258 (60962fb0,13d874,1,4cebfa8)

@[ 3] 0x6002110e nnotes.LSsThread::NRun+206 (4cebfa8,b47a88,b47288,13d8f0)

@[ 4] 0x60023156 nnotes.LSsThread::Run+182 (4cebfa8,13d8d8,61a9316e,b47288)

@[ 5] 0x600b496a nnotes.LSsInstance::Resume+26 (b47288,b479c0,0,b47a88)

@[ 6] 0x61a9316e nnotesws.LSEcInstance::StepClientScript+110 (b479c0,754a774,b479c0,0)

@[ 7] 0x611a8393 nnotesws.LSEcInstance::Resume+243 (b479c0,0,754a774,0)

@[ 8] 0x61a934a9 nnotesws.LSEcInstance::DebugClientScript+169 (b479c0,61251f4,2,13d9dc)

@[ 9] 0x61a91a74 nnotesws._LSEDebugCommand@12+20 (b479c0,61251f4,2,13dbac)

@[10] 0x61a919f2 nnotesws._LSEDebugStepInto@8+18 (b479c0,61251f4,754a774,522aa6c)

@[11] 0x615be4cd nnotesws.CLSDDocument::DebugScript+205 (754a774,2,80000000,66)

@[12] 0x615c1969 nnotesws.CDebuggerPaneSubprogram::ExecuteScript+217 (4ed0ef4,2,66,0)

@[13] 0x615c108e nnotesws.CDebuggerPaneSubprogram::WMCtrlNotify+78 (522aa6c,30670,66,13dcec)

@[14] 0x615c0dbb nnotesws.CDebuggerPaneSubprogram::SubMessageProc+955 (522aa6c,111,80000019,505e8)

@[15] 0x611848f4 nnotesws._MainWndProc@16+6932 (30670,111,80000019,505e8)

[16] 0x7e418734 USER32.GetDC+109 (61182de0,30670,111,80000019)

[17] 0x7e418816 USER32.GetDC+335 (0,61182de0,30670,111)

[18] 0x7e41b4c0 USER32.DefWindowProcW+388 (90e558,111,80000019,505e8)

[19] 0x7e41b50c USER32.DefWindowProcW+464 (13e188,18,90e558,111)

[20] 0x7c90e473 ntdll.KiUserCallbackDispatcher+19 (90e558,111,80000019,505e8)

[21] 0x7e42f3cc USER32.SendMessageA+73 (30670,111,80000019,505e8)

@[22] 0x6118a9a2 nnotesws._BmpButtonWndProc@16+2866 (54414f4,202,0,13001d)

[23] 0x7e418734 USER32.GetDC+109 (61189e70,505e8,202,0)

[24] 0x7e418816 USER32.GetDC+335 (0,61189e70,505e8,202)

[25] 0x7e4189cd USER32.GetWindowLongW+295 (13e53c,0,13e4f4,7e42d99d)

[26] 0x7e418a10 USER32.DispatchMessageW+15 (13e53c,7e42f383,34,13e53c)

[27] 0x7e42d99d USER32.IsDialogMessageW+219 (30670,910b08,4ed0ef4,3066c)

@[28] 0x612cdd05 nnotesws.ModelessWindowDispatch+229 (2,b479c0,754a774,539366c)

@[29] 0x612cdf8f nnotesws._NEMMainLoopIDE@8+271 (0,0,539366c,754a774)

@[30] 0x615be8f9 nnotesws.CLSDDocument::LoadObject+169 (0,539366c,1,754a774)

@[31] 0x615be3a3 nnotesws.CLSDDocument::AddScriptObject+435 (754a7b8,75558f4,1,1)

@[32] 0x615bda41 nnotesws.CLSUIDocument::RunScript+369 (754a774,3f3,13e5cc,609ec974)

@[33] 0x605b632c nnotes.CRawActionLotusScript::Run+700 (3c7,754a774,0,3c7)

@[34] 0x605b2a06 nnotes.CRawAction::Run+54 (0,61251f4,0,13e7a4)

@[35] 0x605b25c3 nnotes.CRawAction::Execute+275 (613bd94,0,13ef8c,605af024)

@[36] 0x605af2f6 nnotes.CAssistant::RunAlone+22 (75540f4,61251f4,61251f4,0)

@[37] 0x605af024 nnotes.CAssistant::Run+3796 (0,13f1e0,1931814,13f2a4)

@[38] 0x615af0cd nnotesws._RunAssistantEx@28+493 (73a88f4,615fa3a,0,0)

@[39] 0x615aeed0 nnotesws._RunAssistant@20+32 (73a88f4,0,0,0)

@[40] 0x61a80c6d nnotesws.CAgentDocSelection::Command+77 (54408f4,13f2a4,40280005,0)

@[41] 0x612cc80b nnotesws.CSelectionManager::ProcessCommand+1179 (1,40280005,0,0)

@[42] 0x612cc21e nnotesws._ProcessWMCommand@8+174 (40280005,0,40280005,111)

@[43] 0x61183e9f nnotesws._MainWndProc@16+4287 (7068c,111,40280005,0)

@[44] 0x612da65c nnotesws._PeerFrameWndProc@16+796 (1405f4,111,40280005,0)

[45] 0x7e418734 USER32.GetDC+109 (612da340,7068c,111,40280005)

[46] 0x7e418816 USER32.GetDC+335 (0,612da340,7068c,111)

[47] 0x7e4189cd USER32.GetWindowLongW+295 (13f7c0,0,13f7e0,612218a8)

[48] 0x7e418a10 USER32.DispatchMessageW+15 (13f7c0,612215e0,61180000,1)

@[49] 0x612218a8 nnotesws._NEMMainLoop@4+712 (401000,80000001,152395,0)

@[50] 0x0040156d nlnotes._WinMain@16+1389 (400000,0,152395,1)

@[51] 0x00401dfa nlnotes._WinMainCRTStartup+308 (80000001,252e0c4,7ffd4000,8054a6ed)

[52] 0x7c816fe7 KERNEL32.RegisterWaitForInputIdle+73 (401cc6,0,78746341,20)

############################################################

PASS 2 : FATAL THREAD with STACK FRAMES 1/12 [ nlnotes:0e58:0c30]

FP=0013d7dc, PC=6096303a, SP=0013d6d4, stksize=264

Exception code: c0000005 (ACCESS_VIOLATION)

############################################################

Subject: RE: UH! replace causes an NSD in the 6.5.4 client!

Sorry, was doing another search, it was the wrong link

Using the LotusScript ArrayAppend function to append a date time value either appends a blank value or causes a crash

Link

JYR

Subject: Jean-Yves: dead link

hi Jean-Yves,

the link in your post does not work - could you possibly fix it?

Thanks,

Uwe