"reuse" in dict symbolic (AREV64)
At 30 JAN 2024 09:05:44PM Barry Stevens wrote:
having a go at converting arev3.12 to arev64.
I have come across this in a symbolic that works in arev3.12 but gives error in OI.
@ans = 1)
1)
(({ITEM_EXT_PRICE} — {ITEM_GST}) — {ITEM_TOTAL_COST}) / ({ITEM_EXT_PRICE}—{ITEM_GST})) * reuse(10000)) "MD0"
the error is with "reuse":
not declared as a function etc etc
Cant find any $reuse in arev object.
Assuming as it is not declared that it is an op code?
Any hints, or maybe code to simulate and I will declare it..
it creates list of @vm repeating values equal to the largest current list - I assume - well thats what I would expect to achieve.
</QUOTE>
—-
=== At 31 JAN 2024 03:47AM Carl Pates wrote: ===
<QUOTE>Barry,
From what I can see the "reuse" opcode was never ported OpenEngine and the Basic+ compiler (it got "reused" for assigned() actually) way back in the early 90s, so it's never been in the product at all.
Carl Pates
</QUOTE>
—-
=== At 31 JAN 2024 04:10AM Andrew McAuley wrote: ===
<QUOTE>The issue with a generic function is that it would EITHER have to assume that the first MV referenced had the maximum number of MVs, or you'd need to pass in all the variables used in the equation to allow the function to determine the max. Assuming all variables had the same number of MVs in the above example you could use
<code>
@ans = (((({ITEM_EXT_PRICE} — {ITEM_GST}) — {ITEM_TOTAL_COST}) / ({ITEM_EXT_PRICE}—{ITEM_GST})) * str(10000 : @Vm, dCount({ITEM_EXT_PRICE}, @Vm))) "MD0"
</code>
Then take the last value off of @Ans - the trailing value mark created by the Str statement adds a null value onto the end,
The Sprezzatura Group
The Sprezzatura Blog
World leaders in all things RevSoft
</QUOTE>
—-
=== At 31 JAN 2024 04:40AM Andrew McAuley wrote: ===
<QUOTE>Actually whilst what I suggested would work it doesn't actually replicate the true functionality of REUSE.
Reuse takes the last value of the provided array and duplicates it as many times as required for the calculation. Pseudo code would be
<code>
loop
whilst valuesToProcess
Get nextReuseValue
if nextReuseValue = "" then nextReuseValue = lastReuseValue
perform operation
repeat
</code>
The Sprezzatura Group
The Sprezzatura Blog
World leaders in all things RevSoft
</QUOTE>
The Sprezzatura Group
The Sprezzatura Blog
World leaders in all things RevSoft
</QUOTE>
—-
=== At 31 JAN 2024 03:10PM Barry Stevens wrote: ===
<QUOTE>
<QUOTE>The issue with a generic function is that it would EITHER have to assume that the first MV referenced had the maximum number of MVs, or you'd need to pass in all the variables used in the equation to allow the function to determine the max. Assuming all variables had the same number of MVs in the above example you could use
<code>
@ans = (((({ITEM_EXT_PRICE} — {ITEM_GST}) — {ITEM_TOTAL_COST}) / ({ITEM_EXT_PRICE}—{ITEM_GST})) *** str(10000 : @Vm, dCount({ITEM_EXT_PRICE}, @Vm))) "MD0"
</code>
Then take the last value off of @Ans - the trailing value mark created by the Str statement adds a null value onto the end,
The Sprezzatura Group
The Sprezzatura Blog
World leaders in all things RevSoft
</QUOTE>
Thanks Andrew, that would work - @ans[-1,1]=''
</QUOTE>
View this thread on the Works forum...



