Table: OurTable
Field name....Type
No................Code
Value............Int
...
On Card form we have:
Variable name..........DataType..Subtype.....Dimensions property
OurArrayVariable......Record.....OurTable....3
OurVariable..............Record.....OurTable.....<Undefined>
What happens with the table record that variable points to when we do this:
SETRANGE(No);
OurArrayVariable[1].Value := 20;
OurArrayVariable[2].Value := 10;
What are the values of:
OurArrayVariable[3].Value and
OurVariable.Value
Hope you know what I mean
Better to be critical then self-critical
Comments
The same happens in an array. If you do: then x[i+n] is not affected.
RIS Plus, LLC
The array thing confuses me.
What if I do this:
OurVariable.Value := 50;
The field "Value" in OurTable changes it's value to 50 - Right?
But what does:
OurArrayVariable[1].Value := 25;
Do you know what an array is?
RIS Plus, LLC
What I don't know is the relation between that array elements and table field Value.
To put it this way:
OurVariable.Value := 50; changes the field "Value" in "OurTable"
Does
OurArrayVariable[1].Value := 25; changes anything in "OurTable"
OurVariable.Value := 50; does NOT change the Value field in our table, it only changes the value of the field in your variable. To save the value to the database, you will have to do OurVariable.MODIFY.
If you do OurVariable.Value := 50; and the MODIFY, and you do OurArrayVariable[1].Value := 25 and then MODIFY you will get an error.
You should create a little test form and play around with this. It is pretty straightforward.
RIS Plus, LLC
We have 5 cursors to same table. 1 and 2 are set to record 1, 3..5 are set to record 3. If you do In the Record 3 in field1 will be Val1. Because each Cursor is copy of the record, and the changes are transfered only with MODIFY (chages from cursor to table) or FIND and GET (read the data from table into cursor). And after the FIND the Val1 will be in Array[5].Field1 too...
etc. etc.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Sorry for beeing boring!
I mixed something, I was looking Form 402 and how (or why) they use arrays of records.
They use "one dimension per tab".
It is nothing more than a data structure to store information that is displayed on the form.
RIS Plus, LLC