Why doesn't the "case of" statement work with strings? lazarus / 43-Android ---------------------------------------------------------------------- shyub · 2021-04-06 10:45 "case of" is very handy for parsing, but gives an error in LAMW. 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 procedure TAndroidModule1.jButton1Click(Sender: TObject);var  S: String;begin  if jRadioButton1.Checked then S:='One';  if jRadioButton2.Checked then S:='Two';  if jRadioButton3.Checked then S:='Three';  if jRadioButton4.Checked then S:='Four';  case S of LAMW    'One': jEditText1.Text:='1';    'Two': jEditText1.Text:='2';    'Three': jEditText1.Text:='3';    'Four': jEditText1.Text:='4';  end;end; Can you fix this? ---------------------------------------------------------------------- MarkMLl · 2021-04-06 11:14 It's your code, /you/ fix it: 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   case S of    'One': jEditText1.Text:='1';    'Two': jEditText1.Text:='2';    'Three': jEditText1.Text:='3';    'Four': jEditText1.Text:='4';  end;  MarkMLl ---------------------------------------------------------------------- shyub · 2021-04-06 11:25 No, it does not work. "LAMW" I accidentally added after checking. ---------------------------------------------------------------------- shyub · 2021-04-06 11:32 Here is the source code ---------------------------------------------------------------------- rsu333 · 2021-04-06 11:38 I think you can avoid case ; suppose jbutton1click   jradiobutton[n].visible:=true;  ------------------------------------------------------- jbutton[n]click jedittext1.text:=[N] ---------------------------------------------------------------------- MarkMLl · 2021-04-06 11:45 Although having got rid of the obvious problem it's still an interesting question. MarkMLl ---------------------------------------------------------------------- shyub · 2021-04-06 11:58 I ran into this problem when porting code from Windows. The code converts the dxf-file to coordinates for subsequent rendering. 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 DxfToLin(SF: String): Boolean;var  n: Integer=0;  S: String;  flagParam: boolean=true;   Xmin, Ymin: Single;begin  Result:=true;  Setlength(Mlin, 0);  SL:=TStringList.Create;  SL.LoadFromFile(SF);   DXF.Deg:=true;   DXF.k:=1;   while n