[solved] How to check if an Integer is a control-character? lazarus / 62-General ---------------------------------------------------------------------- Zvoni · 2020-10-24 09:21 Hi Folks, still translating c-code. How do i check if a Integer is a control-character? Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i int MyFunction(int c){    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||  c == '\v';} 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 MyFunction(c:Integer):BooleanBegin  Result:=(c=Ord(' ')) Or //???????End; For the life of me i can't find anyting for this. And yes, i'm aware that i'm checking if c is a whitespace-character And, no. I'm using {H+} so IsWhiteSpace-Function is not option. EDIT: After reading up on it: Or is it enough to check if #32 and everything <= #13 ? ---------------------------------------------------------------------- Bart · 2020-10-24 09:35 Basically you want to detect CarriageReturn, LineFeed, FormFeed, Space, Tab and VerticalTab. Integer values: CarriageReturn = 13 LineFeed = 10 FormFeed = 12 VertcalTab = 11 Tab = 9 Space = 32 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 MyFunction(C: Integer): Boolean;begin  Result := (C in [9,11,12,13,32]);end; Or 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 MyFunction(C: Char): Boolean;begin  Result := (C in [#9,#11,#12,#13,#32]);end; Bart ---------------------------------------------------------------------- Bart · 2020-10-24 10:04 See also https://en.wikipedia.org/wiki/Escape_sequences_in_C Bart ---------------------------------------------------------------------- Zvoni · 2020-10-24 10:17 Thx Bart, so i was close with my second guess