Skip to content

Commit

Permalink
Create continueBreakTest.gsql
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxiw authored Jan 21, 2025
1 parent fc29a02 commit 4e64be4
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
USE GRAPH financialGraph
CREATE OR REPLACE QUERY ContinueAndBreakTest ( ) {

//output: 1, 3
INT i = 0;
WHILE (i < 3) DO
i = i + 1;
IF (i == 2) THEN
CONTINUE; //go directly to WHILE condition
END;
PRINT i;
END;

//output: 1
i = 0;
WHILE (i < 3) DO
i = i + 1;
IF (i == 2) THEN
Break; //jump out of the WHILE loop
END;
PRINT i;
END;

}

INSTALL QUERY ContinueAndBreakTest

RUN QUERY ContinueAndBreakTest()

0 comments on commit 4e64be4

Please sign in to comment.