Skip to content

Commit

Permalink
Added CHR() function to script engine #92
Browse files Browse the repository at this point in the history
  • Loading branch information
nofeletru committed Jul 25, 2023
1 parent c2c6aa0 commit 9dc854f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions software/scriptsfunc.pas
Expand Up @@ -234,6 +234,16 @@ function Script_IntToHex(Sender:TObject; var A:TVarList; var R:TVar) : boolean;
Result := true;
end;

{Script CHR(byte): char;
Аналог CHR}
function Script_CHR(Sender:TObject; var A:TVarList; var R:TVar) : boolean;
begin
if A.Count < 1 then Exit(false);

R.Value:= CHR(TPVar(A.Items[0])^.Value);
Result := true;
end;

{Script SPIEnterProgMode(speed): boolean;
Инициализирует состояние пинов для SPI и устанавливает частоту SPI
Если частота не установлена возвращает false
Expand Down Expand Up @@ -641,6 +651,7 @@ procedure SetScriptFunctions(PC : TPasCalc);
PC.SetFunction('LogPrint', @Script_LogPrint);
PC.SetFunction('ProgressBar', @Script_ProgressBar);
PC.SetFunction('IntToHex', @Script_IntToHex);
PC.SetFunction('CHR', @Script_CHR);

PC.SetFunction('ReadToEditor', @Script_ReadToEditor);
PC.SetFunction('WriteFromEditor', @Script_WriteFromEditor);
Expand Down

0 comments on commit 9dc854f

Please sign in to comment.