Hello,
I like functions like DELCHR better where possible, as they can do the hard work for you. But if nothing else works, you can scan the string char by char and keep the chars that you want. A string is an array of characters, so this is what you can do:
OBJECT Codeunit 99996 Make Number
{
OBJECT-PROPERTIES
{
Date=20/10/21;
Time=16:56:52;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=BEGIN
Code := '*oh06es/\@wa08=-hed95';
FOR i := 1 TO STRLEN(Code) DO BEGIN
Char := Code[i];
IF EVALUATE(TestNumber,FORMAT(Char)) THEN
ResultTxt := ResultTxt + FORMAT(Char);
END;
EVALUATE(ResultNumber,ResultTxt);
MESSAGE(FORMAT(ResultNumber));
END;
}
CODE
{
VAR
Code@1000 : Code[10];
Char@1001 : Char;
TestNumber@1005 : Integer;
i@1002 : Integer;
ResultTxt@1003 : Text;
ResultNumber@1004 : Integer;
BEGIN
END.
}
}