From 45bf68fad4aac8591522137866c680e7331d3b5a Mon Sep 17 00:00:00 2001 From: SteveMcNeill Date: Mon, 30 Oct 2023 10:51:14 -0400 Subject: [PATCH] Error Report before REDIM, not after --- README.md | 2 ++ source/qb64pe.bas | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 51e81f3a6..9f946b966 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,5 @@ We have a community forum at: https://qb64phoenix.com/forum We don't currently tweet. Sorry. Find us on Discord: https://discord.gg/D2M7hepTSx + +Join us on Reddit: https://www.reddit.com/r/QB64pe/ diff --git a/source/qb64pe.bas b/source/qb64pe.bas index 5e2e1c1ca..a99b52c77 100644 --- a/source/qb64pe.bas +++ b/source/qb64pe.bas @@ -11767,16 +11767,16 @@ FOR i = 1 TO idn unresolved = unresolved + 1 sflistn = sflistn + 1 + IF sflistn > 25000 THEN 'manually set a descriptive error message for the user so they know what's happening. + Error_Message = "ERROR: QB64PE currently limits a program to have a maximum of 25,000 subs and functions, and this limit has been exceeded. Please reduce Sub/Function count, or else report this issue with sample code that produced it over at the QB64PE forums, so we can look further into this issue." + GOTO errmes + END IF ubound_sf = UBOUND(sfidlist) 'all 3 should have the same limit IF sflistn > ubound_sf THEN REDIM _PRESERVE sfidlist(ubound_sf + 1000) AS LONG REDIM _PRESERVE sfarglist(ubound_sf + 1000) AS INTEGER REDIM _PRESERVE sfelelist(ubound_sf + 1000) AS INTEGER END IF - IF ubound_sf > 25000 THEN 'manually set a descriptive error message for the user so they know what's happening. - Error_Message = "ERROR: QB64PE currently limits a program to have a maximum of 25,000 subs and functions, and this limit has been exceeded. Please reduce Sub/Function count, or else report this issue with sample code that produced it over at the QB64PE forums, so we can look further into this issue." - GOTO errmes - END IF sfidlist(sflistn) = i sfarglist(sflistn) = i2 sfelelist(sflistn) = nelereq '0 means still unknown