• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revisão2756 (tree)
Hora2021-07-23 03:46:38
Autorumethyl

Mensagem de Log

Stack::AddNumber()

Mudança Sumário

Diff

--- trunk/include/system_class.php (revision 2755)
+++ trunk/include/system_class.php (revision 2756)
@@ -162,6 +162,19 @@
162162 $this->Set($name, $stack);
163163 }
164164
165+ //数値加算
166+ public function AddNumber($name, $data) {
167+ //Text::p($data, "◆Stack/AddNumber[{$name}]");
168+ $number = $this->Get($name);
169+ if (null === $number) {
170+ $number = $data;
171+ } else {
172+ $number += $data;
173+ }
174+
175+ $this->Set($name, $number);
176+ }
177+
165178 //存在判定
166179 public function Exists($name) {
167180 //Text::p($name, '◆Stack/Exists');
Show on old repository browser