-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BUG] NEXT in FOR/NEXT loop not recognized if preceded by a Label #104
Comments
I am unable to reproduce this problem using the code example that you provided. Which version of the extension are you using? The latest is 2.0.6. |
Brent,
It is likely that it is some of the code before or after the loops that is causing your behavior. Did you check it with just the snippet that you sent?
Dick
From: Brent Blair <[email protected]>
Reply-To: mvextensions/mvbasic <[email protected]>
Date: Monday, June 1, 2020 at 12:24 PM
To: mvextensions/mvbasic <[email protected]>
Cc: Subscribed <[email protected]>
Subject: [mvextensions/mvbasic] [BUG] Lint does not see NEXT in FOR NEXT loop (#104)
Describe the bug
It the text and attached image, the Lint does not see shows a missing NEXT L for the FOR L. It highlights the error under the NEXT L that is saying is missing.
To Reproduce
FOR P=1 TO NUM.PARTS
FOR L=1 TO LOC.CNT
THIS.AVAIL.QTY=PARTS.ARRAY<7,P,L>
ORDER.QTY=PARTS.ARRAY<5,P>
IF THIS.AVAIL.QTY >= ORDER.QTY THEN
PARTS.ARRAY<11,P>=PARTS.ARRAY<8,P,L>
GOTO 103
END
NEXT L
IF PARTS.ARRAY<11,P>="" THEN GOSUB BACKORDER.LOCATION.CHECK
103
NEXT P
Screenshots
[Code_jWfFWF3H8m]<https://user-images.githubusercontent.com/23214321/83435735-bc0fc600-a40a-11ea-9b5d-e9783cd43982.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#104>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOODLZ3X5O3IGMHLRLZNA3RUPP4LANCNFSM4NP732XQ>.
|
I am using 2.0.6. I tried a few other things. I copied just that portion
of the code to a new program, and there is no error. In the original
program, I have this similar loop above the code where the error shows.
NUM.PARTS=DCOUNT(PARTS.ARRAY<1>,VM)
LOC.CNT=DCOUNT(ROUTE.LOC.ARRRAY<1>,VM)
FOR P=1 TO NUM.PARTS
BASE.PN=PARTS.ARRAY<2,P>
FOR L=1 TO LOC.CNT
THIS.LOC=ROUTE.LOC.ARRRAY<1,L>
PARTS.ARRAY<7,P,L>="0" ;*AVAIL BY SUBVALUED BY LOCATION
PARTS.ARRAY<8,P,L>=THIS.LOC ;*LOCATION NUMBER
IF BASE.PN="C" THEN GOTO 102
CHECK.LOC=THIS.LOC
CALL GET.PRODUCT.AVAILABILITY.SOE(BASE.PN,AVAIL,CHECK.LOC)
PARTS.ARRAY<7,P,L>=AVAIL ;*AVAIL BY SUBVALUED BY LOCATION
102 NEXT L
NEXT P
If I change the code to this, it works:
NUM.PARTS=DCOUNT(PARTS.ARRAY<1>,VM)
LOC.CNT=DCOUNT(ROUTE.LOC.ARRRAY<1>,VM)
FOR P=1 TO NUM.PARTS
BASE.PN=PARTS.ARRAY<2,P>
FOR L=1 TO LOC.CNT
THIS.LOC=ROUTE.LOC.ARRRAY<1,L>
PARTS.ARRAY<7,P,L>="0" ;*AVAIL BY SUBVALUED BY LOCATION
PARTS.ARRAY<8,P,L>=THIS.LOC ;*LOCATION NUMBER
IF BASE.PN="C" THEN CONTINUE
CHECK.LOC=THIS.LOC
CALL GET.PRODUCT.AVAILABILITY.SOE(BASE.PN,AVAIL,CHECK.LOC)
PARTS.ARRAY<7,P,L>=AVAIL ;*AVAIL BY SUBVALUED BY LOCATION
NEXT L
NEXT P
It seems it does not like the use of a line number before a NEXT, but it
gets confused on which line the error is actually. Either way works as
valid code on jBase. I understand that CONTINUE with no line number is
probably better, but we migrated to jBase from a system that did not have
the CONTINUE verb. Also there are some cases where there is a loop inside
of a loop, and I need to BREAK from the inner loop, and CONTINUE to the
outer loop. Sometimes that is just easier with a line number.
*Brent Blair* <http://www.linkedin.com/in/BrentLBlair>
Vice President of IT
Encompass
Phone 954.474.0300
Fort Lauderdale, FL
<https://www.google.com/maps/place/Encompass+Parts+Distribution/@26.145357,-80.2482168,12.46z/data=!4m5!3m4!1s0x0:0xb2bfe23d3412449!8m2!3d26.0920996!4d-80.2409538>
[email protected]
encompass.com
…On Mon, Jun 1, 2020 at 1:37 PM Kevin Powick ***@***.***> wrote:
I am unable to reproduce this problem using the code example that you
provided.
Which version of the extension are you using? The latest is 2.0.6.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#104 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRDR4M6Z3VIWP5JFIRA463RUPRPBANCNFSM4NP732XQ>
.
|
You are correct that the numbered label preceding the As you noted, you can use
I get it, especially when porting a codebase to a different platform. However, in the case you describe, I would probably set a flag on the inner loop so that if one uses
|
BTW, I'm working on other aspects for Again, thanks for reporting it. |
- Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable.
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]>
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 * Re-introduce accidentally deleted /doc files * Fixes issue 107: FOR/NEXT error when no whitespace after FOR variable. * Shipping 2.0.8 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]>
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 * Re-introduce accidentally deleted /doc files * Fixes issue 107: FOR/NEXT error when no whitespace after FOR variable. * Shipping 2.0.8 * Issue #110: Do not change indentation of comment lines * Issue #111: Added user setting to control indentation of comment lines. * Bump elliptic from 6.5.2 to 6.5.3 (#119) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Extension Guide.md Updated AccuTerm connector and host program links. * Feature request 113 (#121) * Update package.json Added MVBasic.customFunctionPath * Update server.ts added functionality to Load CustomFunction definition * Add files via upload * Update Extension Guide.md added documentation for Custom functions and subroutines 6.8 * Update server.ts Removed `data: functions[i].index,` for now since Microsoft has not responded yet. It works without it, and it's no longer in the Microsoft API documentation. * - Fix issue with startLoop/endLoop in server code parser - Clean up unused variable in server - Expand docs on new customFunctions feature * Shipping 2.0.9 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brent Blair <[email protected]>
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 * Re-introduce accidentally deleted /doc files * Fixes issue 107: FOR/NEXT error when no whitespace after FOR variable. * Shipping 2.0.8 * Issue #110: Do not change indentation of comment lines * Issue #111: Added user setting to control indentation of comment lines. * Bump elliptic from 6.5.2 to 6.5.3 (#119) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Extension Guide.md Updated AccuTerm connector and host program links. * Feature request 113 (#121) * Update package.json Added MVBasic.customFunctionPath * Update server.ts added functionality to Load CustomFunction definition * Add files via upload * Update Extension Guide.md added documentation for Custom functions and subroutines 6.8 * Update server.ts Removed `data: functions[i].index,` for now since Microsoft has not responded yet. It works without it, and it's no longer in the Microsoft API documentation. * - Fix issue with startLoop/endLoop in server code parser - Clean up unused variable in server - Expand docs on new customFunctions feature * Shipping 2.0.9 * Update server.ts It looks like I left the line `customFunctionPath = settings.MVBasic.customFunctionPath;` out of the merge. * Shipping v2.0.10 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brent Blair <[email protected]>
Describe the bug
It the text and attached image, the Lint does not see shows a missing NEXT L for the FOR L. It highlights the error under the NEXT L that is saying is missing.
To Reproduce
FOR P=1 TO NUM.PARTS
FOR L=1 TO LOC.CNT
THIS.AVAIL.QTY=PARTS.ARRAY<7,P,L>
ORDER.QTY=PARTS.ARRAY<5,P>
IF THIS.AVAIL.QTY >= ORDER.QTY THEN
PARTS.ARRAY<11,P>=PARTS.ARRAY<8,P,L>
GOTO 103
END
NEXT L
IF PARTS.ARRAY<11,P>="" THEN GOSUB BACKORDER.LOCATION.CHECK
103
NEXT P
Screenshots
The text was updated successfully, but these errors were encountered: