Syntax Error in Case Statement Using Scripter

Hello Support Team,

I am experiencing a syntax error in my script while using a case statement. The objective of the script is to categorize characters in a string as letters, figures, spaces, or special characters. The syntax error occurs specifically at the case statement. Here's the script:

  metin: string;
  karakter: Char;
  index : Integer;

  metin := 'SalI<ha12';
  index := 1;
  while (index <= Length(metin)) do
    karakter := metin[index];
    case karakter of
       'a'..'z', 'A'..'Z': ShowMessage(karakter+' is a letter.');
       '0'..'9': ShowMessage(karakter +' is a figure.');
       ' ', #9, #10, #13: ShowMessage('A space or space-like character.');
        ShowMessage(karakter+' is a special character.');

Could you please assist me in identifying the cause of the syntax error and suggest how I can correct it? If the case statement isn't compatible with your scripting environment, what alternative construct can I use to achieve the same result?

Thank you for your help.

You didn't provide the syntax error message you are getting, but then my guess is that it's because the 'a'..'z' construction. TMS Scripter doesn't support range values in case statements. To accomplish that, you have to implement your logic using if statements.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.