It is possible to replace the built-in command with your own version of the functionality through aliases.
Try to use this code. To check enter the command "
/set_calc":
alias set_calc {
set -s %a 2+3 -5 * 8
set -s %b a + b
set -s %c
set -s %d % $+ a
set -s %e %d + 1
;--------------------------
echo -s $eval(%a,0) =40 %a
echo -s $eval(%b,0) =40 %b
echo -s $eval(%c,0) =40 %c
echo -s $eval(%d,0) =40 %d
echo -s $eval(%e,0) =40 %e
}
alias -l set {
if (- == $left($1,1) && s isin $1) {
if ($3) var %value $calc($3-) | else var %value $null
echo $color(info) -a * Set $2 to %value | set $2 %value
}
else set $1 $calc($2-)
}
![[Linked Image from i.ibb.co]](https://i.ibb.co/K67xhtB/set-calc.jpg)
With this method of assigning variables (line by line), the variable "
%e" will be equal to "
-34", but this can certainly be fixed
:-]You can also try to implement this method so that it accepts all variable values in one line, separated by commas.