I try to check if the value assigned to a variable s is in the range '0' .. '9'. (Range may be different). Can I write something like this so as not to list all the values? Of course, I guess that you can check the range with> <but maybe there is some other way?

procedure MyBeforeInstall(); var s: string; begin s := '1'; if s in '0'..'9' then //< ошибка Type mismatch MsgBox('in range', mbInformation, MB_OK); else MsgBox('out of range', mbInformation, MB_OK); end; 
  • @Saidolim. By the way in the Inno-Setup section [code] - service - androschuk

3 answers 3

I'll try to guess:

 if ord(s) in ord('0')..ord('9') then 
  • Most likely the if s in construction is not supported - androschuk

maybe so

 procedure MyBeforeInstall(); var s: char; begin s := '1'; if s in '0'..'9' then //< ошибка Type mismatch MsgBox('in range', mbInformation, MB_OK); else MsgBox('out of range', mbInformation, MB_OK); end; 
  • The attempt is not bad, but the feeling is that the construction of the form is not supported: if s in - androschuk

No longer relevant, but I think you can solve it by writing a function in Delphi and exporting it to InnoSetup.

InnoSetup:

 function CheckRange(Value, MinValue, MaxValue : PChar): boolean; external 'CheckRange@files:MyCommon.dll stdcall delayload'; 

Delphi:

 function CheckRange(Value, MinValue, MaxValue : PChar): boolean; stdcall; begin //проверка диапазона end;