Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6461 > unrolled thread
| Started by | "Fred Killet" <killet-nospam@killetsoft.de> |
|---|---|
| First post | 2014-01-08 08:12 +0100 |
| Last post | 2014-01-17 08:25 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
STRUCTURE with two dimensional array "Fred Killet" <killet-nospam@killetsoft.de> - 2014-01-08 08:12 +0100
Re: STRUCTURE with two dimensional array "Jamal" <someone@example.com> - 2014-01-10 11:42 -0500
Re: STRUCTURE with two dimensional array "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-01-12 22:18 +0100
Re: STRUCTURE with two dimensional array "Fred Killet" <killet-nospam@killetsoft.de> - 2014-01-17 08:25 +0100
| From | "Fred Killet" <killet-nospam@killetsoft.de> |
|---|---|
| Date | 2014-01-08 08:12 +0100 |
| Subject | STRUCTURE with two dimensional array |
| Message-ID | <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
[toc] | [next] | [standalone]
| From | "Jamal" <someone@example.com> |
|---|---|
| Date | 2014-01-10 11:42 -0500 |
| Message-ID | <lap7tn$lc6$1@speranza.aioe.org> |
| In reply to | #6461 |
Fred,
Your code is not complete. What is aQ in REAL8(aQ[nI,nJ]) ?
Did you define properly?
I suggest you break your code further and debug.
Jamal
"Fred Killet" wrote in message
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
[toc] | [prev] | [next] | [standalone]
| From | "Urs Eggmann" <Urs.Eggmann@shinternet.ch> |
|---|---|
| Date | 2014-01-12 22:18 +0100 |
| Message-ID | <bjgf6aFmv0sU1@mid.individual.net> |
| In reply to | #6461 |
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" <killet-nospam@killetsoft.de> 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
>
[toc] | [prev] | [next] | [standalone]
| From | "Fred Killet" <killet-nospam@killetsoft.de> |
|---|---|
| Date | 2014-01-17 08:25 +0100 |
| Message-ID | <52d8dad7$0$6557$9b4e6d93@newsspool4.arcor-online.net> |
| In reply to | #6492 |
Hi, thanks for your help. I found the solution. The examples code I wrote here is correct. There is a property that must be set for the function using that code: Right click on the function / method name. Click on "Properties". Click on "Entity Compiler Options". Reset of the checkbox "Range Checking". then the code works as expected!! Kind regards, Fred "Urs Eggmann" <Urs.Eggmann@shinternet.ch> schrieb im Newsbeitrag news:bjgf6aFmv0sU1@mid.individual.net... > 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" <killet-nospam@killetsoft.de> 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 >> > --- Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv. http://www.avast.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web