Identifier not found "IsCharUpper" lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- hungrybyte · 2016-09-10 13:24 Hello! Got a little problem with my Lazarus project here: Identifier not found "IsCharUpper" and the same with Lower. The code i use: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     High:=High or IsCharUpper(Pass[i]);    Low:=Low or IsCharLower(Pass[i]);       so the question is, can i use this function in lazarus at all? or its no go for it? ---------------------------------------------------------------------- howardpc · 2016-09-10 14:18 If you are only interested in ASCII characters then you can use these functions: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function IsAsciiCharUpper(aChar: Char): boolean;begin  Exit((aChar >= 'A') and (aChar <= 'Z'));  end; function IsAsciiCharLower(aChar: Char): boolean;begin Exit((aChar >= 'a') and (aChar <= 'z'));  end; ---------------------------------------------------------------------- derek.john.evans · 2016-09-10 14:48 Eeekk  Is that how you have been checking upper/lower case? Why not Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i const  TUpperCase = ['A'..'Z'];  TLowerCase = ['a'..'z'];     if C in TUpperCase then begin    ShowMessage('C is Uppercase');  end; ---------------------------------------------------------------------- howardpc · 2016-09-10 15:06 Quote from: Geepster on September 10, 2016, 04:48:42 pmEeekk  Is that how you have been checking upper/lower case? Sometimes, yes, though more often one does not know in advance if there might be multibyte utf8 codes to be checked, when the functions I offered are of course useless. There are usually numerous ways to answer programming questions. It happens for the special case of ASCII upper/lower there is this simple test based on the way the ASCII table was designed. It has almost no memory impact at all (it requires no set constants to be declared) and is fast since it does no lookups either.  It could also be inlined if speed is of the essence. ---------------------------------------------------------------------- derek.john.evans · 2016-09-10 15:15 Quote from: howardpc on September 10, 2016, 05:06:31 pmSometimes, yes, though more often one does not know in advance if there might be multibyte utf8 codes to be checked, when the functions I offered are of course useless. But, 'A'..'Z' is #65..#90. Your functions look like they would fail since they test blocks of 32 chars. not 26 ---------------------------------------------------------------------- Leledumbo · 2016-09-10 15:19 Quote from: hungrybyte on September 10, 2016, 03:24:56 pmHello! Got a little problem with my Lazarus project here: Identifier not found "IsCharUpper" and the same with Lower. so the question is, can i use this function in lazarus at all? or its no go for it?  It's a Windows function, so add Windows to your uses clause (bye2 cross platform). First thing to do whenever an identifier is not found is to search in what unit it belongs to. Whether it's a go or no go is up to you, I for certain won't use it. I code on and for Linux most of the time nowadays. ---------------------------------------------------------------------- marcov · 2016-09-10 15:28 Character unit has such identifiers for unicode purposes (3.0+) ---------------------------------------------------------------------- howardpc · 2016-09-11 11:21 Quote from: Geepster on September 10, 2016, 05:15:25 pmBut, 'A'..'Z' is #65..#90. Your functions look like they would fail since they test blocks of 32 chars. not 26 Well spotted. I've edited the functions to return correct results.