You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using a Single Board Computer (RaspberryPi) with your Duet?
Yes I use a SBC.
No I do not use a SBC.
Please upload the results of sending M122 in the gcode console.
No response
Please upload the content of your config.g file.
No response
Please upload the content of any other releveant macro files.
; Example on a standard vector
var testVector = { "A","B","C","D" }
; Expected: true, Actual: "C"
echo { exists(var.testVector[2]) }
Details specific to your printer.
N/A
Links to additional info.
No response
What happened?
Expected result
Meta gcode function exists() could be called on an array index and identify whether the index exists in the array.
Observed result
Meta gcode function exists() simply returns the value of the item at the array index, if valid, or throws an index out of bounds error if not.
Steps to reproduce
; Example on a standard vector
var testVector = { "A","B","C","D" }
; Expected: true, Actual: "C"
echo { exists(var.testVector[2]) }
; On blank tool table, which is only extended up to the highest tool defined
M563 P5 S"Test" R0
echo { exists(tools[5]) } ; Returns tool 5 object
echo { exists(tools[49]) } ; Throws array index out of bounds error if tool 49 is not defined
The text was updated successfully, but these errors were encountered:
I confirmed and fixed in the 3.5-dev source code the bug with exists and indexing into testVector. Thanks for reporting this. I was unable to reproduce the bug with exists and indexing into the tools array. Log of test (read in reverse order):
Duet Forum Discussion Thread
https://forum.duet3d.com/topic/34967/function-exists-does-not-work-correctly-with-array-elements/2?_=1707983978816
Which Duet products are you using?
Firmware Version
3.5.0-rc.3+101
(STM32)Duet Web Control Version
3.5.0-rc.3
Are you using a Single Board Computer (RaspberryPi) with your Duet?
Please upload the results of sending M122 in the gcode console.
No response
Please upload the content of your config.g file.
No response
Please upload the content of any other releveant macro files.
Details specific to your printer.
N/A
Links to additional info.
No response
What happened?
Expected result
Meta gcode function
exists()
could be called on an array index and identify whether the index exists in the array.Observed result
Meta gcode function
exists()
simply returns the value of the item at the array index, if valid, or throws an index out of bounds error if not.Steps to reproduce
The text was updated successfully, but these errors were encountered: