Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Urs Eggmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: STRUCTURE with two dimensional array Date: Sun, 12 Jan 2014 22:18:26 +0100 Lines: 84 Message-ID: References: <52ccfa58$0$9525$9b4e6d93@newsspool1.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Trace: individual.net nArDgk02GJV4vEYI1/SVuwzJbIiZP4oq/Ourqul/m6UfR9GOMW Cancel-Lock: sha1:rXI1qZ96M7S9gPUq9YP4QeFEfls= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-EsetId: 37303A2992966C64637760 X-EsetScannerBuild: 16623 Xref: csiph.com comp.lang.clipper.visual-objects:6492 Hello Fred, First, I was not able to help you, then Jamal gave me the idea for some simple code. Bound Error occurs when the code access a arrayelement outside the array. May be it helps a bit. regards Urs ****************************** STRUCTURE stKart MEMBER DIM a[20,3] AS DWORD METHOD TestButton( ) CLASS dtaTest11 LOCAL nI , nJ , nMz AS DWORD LOCAL stKartQ IS stKart // IS for automatic allocation of memory nMz := 20 FOR nI:=1 UPTO nMz FOR nJ:=1 UPTO 3 stKartQ.a[nI,nJ] := nJ + nI // just to make it visible NEXT nJ NEXT nI FOR nI:=1 UPTO nMz ? stKartQ.a[nI,1] , stKartQ.a[nI, 2] , stKartQ.a[nI,3] // NEXT nI RETURN NIL /* Output: 2 3 4 3 4 5 4 5 6 5 6 7 6 7 8 7 8 9 8 9 10 9 10 11 10 11 12 11 12 13 12 13 14 13 14 15 14 15 16 15 16 17 16 17 18 17 18 19 18 19 20 19 20 21 20 21 22 21 22 23 */ ****************************** "Fred Killet" schrieb im Newsbeitrag news:52ccfa58$0$9525$9b4e6d93@newsspool1.arcor-online.net... > Hello dear VO developers, > > what do I wrong? > > LOCAL stKartQ AS stKart > nMz := 20 > stKartQ := MemAlloc(nMz * _sizeof(stKart)) > FOR nI:=1 UPTO nMz > FOR nJ:=1 UPTO 3 > stKartQ.a[nI,nJ] := REAL8(aQ[nI,nJ]) > NEXT nJ > NEXT nI > > STRUCTURE stKart > MEMBER DIM a[1,3] AS REAL8 > > When reaching stKartQ[2,1] the program stops and there comes up a Message > "Bound Error". > Thank you for your help! > Kind regards Fred > -- > > > Fred Killet > killet-nospam@killetsoft.de > > --- > Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus > Schutz ist aktiv. > http://www.avast.com >