Hello,
why this doesn't work ?
class:
define
public static property cValueArray as character no-undo extent 5
get.
set.
end
class.
Class:cValueArray[1] = "0".
This sets all extent to 0 and not only extent 1.
But within the static class cValueArray[1] = "0" works fine (as expected).
But this should work inside AND outside!
Workaround:
define variable cValueArray as character no-undo extent 5.
cValueArray = FormulaService:cValueArray.
cValueArray[1] = "0"
Class:cValueArray = cValueArray.
Stefan
marquardt wrote:
Hello,
why this doesn't work ?
class:
define
public static property cValueArray as character no-undo extent 5
get.
set.
end
class.
Class:cValueArray[1] = "0".
This sets all extent to 0 and not only extent 1.
But within the static class cValueArray[1] = "0" works fine (as expected).
But this should work inside AND outside!
Workaround:
define variable cValueArray as character no-undo extent 5.
cValueArray = FormulaService:cValueArray.
cValueArray[1] = "0"
Class:cValueArray = cValueArray.
Stefan
In 10.2B04, I tried
class ouch:
define public static property cValueArray as character no-undo extent 5 get. set.
end class.
Ouch:cValueArray[1] = "0".
MESSAGE
Ouch:cValueArray[1] skip
Ouch:cValueArray[2] skip
Ouch:cValueArray[3] skip
Ouch:cValueArray[4] skip
Ouch:cValueArray[5] skip
VIEW-AS ALERT-BOX INFO BUTTONS OK.
And I see:
---------------------------
Information (Press HELP to view stack trace)
---------------------------
0
---------------------------
OK Help
---------------------------
-- peter
Peter,
opened WR W104130068.
Running 10.2B04 (32bit) on Windows 7.
This is the full code:
do
iKey = 1 to 5:
if FormulaService:lDisplayArray[iKey] then
do:
iValue = integer(FormulaService:cKeyArray[iKey]).
if iValue > 0 then
do:
message
iKey skip
FormulaService:cValueArray[1] skip
FormulaService:cValueArray[2] skip
FormulaService:cValueArray[3] skip
FormulaService:cValueArray[4] skip
FormulaService:cValueArray[5] skip
view-as alert-box.
FormulaService:cValueArray[iKey] = buffer ttReceiptRowFormulaValue:buffer-field(substitute ("Value&1", iValue)):buffer-value ().
message
iKey skip
FormulaService:cValueArray[1] skip
FormulaService:cValueArray[2] skip
FormulaService:cValueArray[3] skip
FormulaService:cValueArray[4] skip
FormulaService:cValueArray[5] skip
view-as alert-box.
end.
end.
end.
Stefan
Peter,
this behaviour only happens when i assign a buffer value directly.
Workarund is using a variable (like bug OE 00155893 described in P125455 which seems to need years for fixing).
using prohibisCash.Services.Formula.FormulaService from propath.
DEF VAR iKey AS INTEGER NO-UNDO.
DEF VAR iKeyValue AS INT NO-UNDO.
DEF VAR cValue AS CHAR NO-UNDO.
DEFINE TEMP-TABLE ttReceiptRowItem LIKE ReceiptRowItem.
DEFINE TEMP-TABLE ttReceiptRowFormulaValue LIKE ReceiptRowFormulaValue.
FIND LAST ReceiptRowItem WHERE ReceiptRowItem.ITEM = "KAS00302".
BUFFER-COPY ReceiptRowItem TO ttReceiptRowItem.
FIND ReceiptRow OF ReceiptRowItem.
FIND ReceiptRowFormulaValue OF ReceiptRow.
BUFFER-COPY ReceiptRowFormulaValue TO ttReceiptRowFormulaValue.
FormulaService:SetEntryFields (ttReceiptRowItem.ITEM).
DO iKey = 1 TO 5:
if FormulaService:lDisplayArray[iKey] then
do:
iKeyValue = integer(FormulaService:cKeyArray[iKey]).
if iKeyValue > 0 then
do:
cValue = buffer ttReceiptRowFormulaValue:buffer-field(substitute ("Value&1", iKeyValue)):buffer-value ().
message
iKey cValue SKIP
FormulaService:cValueArray[1] skip
FormulaService:cValueArray[2] skip
FormulaService:cValueArray[3] skip
FormulaService:cValueArray[4] skip
FormulaService:cValueArray[5] skip
view-as alert-box.
/* This sets all Extents */
/* FormulaService:cValueArray[iKey] = buffer ttReceiptRowFormulaValue:buffer-field(substitute ("Value&1", iKeyValue)):buffer-value (). */
/* This sets only Extent iKey as expected */
FormulaService:cValueArray[iKey] = cValue.
MESSAGE
iKey cValue SKIP
FormulaService:cValueArray[1] skip
FormulaService:cValueArray[2] skip
FormulaService:cValueArray[3] skip
FormulaService:cValueArray[4] skip
FormulaService:cValueArray[5] skip
view-as alert-box.
END.
END.
END.
What is wrong with this?
Workarund is using a variable (like bug OE 00155893 described in P125455 which seems to need years for fixing).
(or setting property without [])
Stefan
It's a bug(again) !
OE00206787
ID: P186122 Title: "Cannot assign an array element directly from a buffer value." | |
Created: 04/18/2011 | Last Modified: 04/18/2011 |
Status: Unverified |
Very funny - unverified ...
Have you ever seen a "verified" one? Lol
It is verified when PSC has tested it internally. Perfectly sensible.
Hmm over 1,000 results for "unverified bug#" in my desktop version of ProKB. So they can verify bugs without testing? Impressive!