Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra indentation causes script not to work #897

Closed
2 of 25 tasks
dc42 opened this issue Aug 24, 2023 · 2 comments
Closed
2 of 25 tasks

Extra indentation causes script not to work #897

dc42 opened this issue Aug 24, 2023 · 2 comments
Assignees
Labels
bug Bug that has been reproduced
Milestone

Comments

@dc42
Copy link
Collaborator

dc42 commented Aug 24, 2023

Duet Forum Discussion Thread

https://forum.duet3d.com/topic/33363/writing-variables-to-a-file-problems-with-nested-echo-commands

Which Duet products are you using?

  • Duet2-Wifi
  • Duet2-Ethernet
  • Duet Expansion Breakout Board
  • Duex2
  • Duex5
  • Duet2-Maestro
  • Maestro Dual Driver Expansion
  • Duet3-6HC
  • Duet3-3HC
  • Duet3-1XD
  • Duet3-1LC
  • Duet3-Tool Distribution Board
  • Duet3-Mini5+
  • Duet3-Mini2+
  • Raspberry Pi or other SBC
  • SmartEffector
  • Magnetic Filament Sensor
  • Laser Filament Sensor
  • PT100 Daughterboard
  • Thermocouple Daughterboard
  • PanelDue
  • Other
  • None

Firmware Version

3.5.0-beta.4

Duet Web Control Version

3.5.0-beta.4

Are you using a Single Board Computer (RaspberryPi) with your Duet?

  • Yes I use a SBC.
  • No I do not use a SBC.

What happened?

Additional indentation between a M291 command in an if-block and a following nested if-block appears to cause the nested if-block not to be executed. Un-indenting the if-block relative to the M291 command solved it. Inserting an un-indented echo command between the M291 command and the indented if-block also solved it.

@dc42 dc42 added the bug Bug that has been reproduced label Aug 24, 2023
@dc42 dc42 added this to the 3.5.0 milestone Aug 24, 2023
@dc42 dc42 self-assigned this Aug 24, 2023
@dc42
Copy link
Collaborator Author

dc42 commented Aug 25, 2023

Simple test script to demonstrate the problem:

if true
    M291 S2 P"Press OK"
        echo "got ok"

Another example:

if true
    M120
    M121
        echo "got ok"

In both cases the "got ok" message is not echoed, unless either it is not indented wrt the previous M291 or M121 command, or another echo command that is not indented is inserted before it.

@dc42
Copy link
Collaborator Author

dc42 commented Aug 25, 2023

Fixed in 3.5-dev branch.

@dc42 dc42 closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that has been reproduced
Projects
None yet
Development

No branches or pull requests

1 participant