Ian Branch 127 Posted January 11, 2022 Hi Team, Any idea why only 7 procedures/functions are being shown in the attached image when there are clearly many more?? Regards & TIA, Ian Screenshot_9.bmp Share this post Link to post
Uwe Raabe 2057 Posted January 11, 2022 9 hours ago, Ian Branch said: Any idea why only 7 procedures/functions are being shown in the attached image when there are clearly many more?? Probably something in your code we cannot see that the parser stumbles upon. Share this post Link to post
Ian Branch 127 Posted January 11, 2022 Great Call Uwe, If I comment out this function.. function ValidEmail(const EmailAddress: string): Boolean; const EMAIL_REGEX = '^((?>[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)' + '(?>\.?[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]' + '{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d))' + '{4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\' + '[\x01-\x7f])+)\])(?(angle)>)$'; var Emails: TStringList; begin Result := True; Emails := TStringList.Create; try Emails.Delimiter := ';'; Emails.StrictDelimiter := True; Emails.DelimitedText := EmailAddress; for var I := 0 to Emails.Count - 1 do if not TRegEx.IsMatch(Emails[I], EMAIL_REGEX) then begin Result := False; Break; end; finally Emails.Free; end; // end; Then all the procedures/functions show. Through a process of trial and error I found that if I change the code to the following.. function ValidEmail(const EmailAddress: string): Boolean; const EMAIL_REGEX = '^((?>[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)' + '(?>\.?[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]' + '{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d))' + '{4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\' + '[\x01-\x7f])+)\])(?(angle)>)$'; var Emails: TStringList; I: SmallInt; // <<<<<< Add this begin Result := True; Emails := TStringList.Create; try Emails.Delimiter := ';'; Emails.StrictDelimiter := True; Emails.DelimitedText := EmailAddress; for I := 0 to Emails.Count - 1 do // <<<<<<<<<<<< Change this.. if not TRegEx.IsMatch(Emails[I], EMAIL_REGEX) then begin Result := False; Break; end; finally Emails.Free; end; // end; No more issue.. This is in D10.4.2. I get the same in D11. :-( Regards and thanks again for the pointer... Ian Share this post Link to post
Uwe Raabe 2057 Posted January 12, 2022 Historically the IDE uses several parsers for different functionality. The goal is to move all these to the new LSP approach, but that needs time. Share this post Link to post
Ian Branch 127 Posted January 12, 2022 Grrrrr!!! Checking through other Units/Projects I have found repeated instances of this happening where I have declared in-line variables. :-( Back to the old/original way of declaring them.. Share this post Link to post