Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

Caché Basic ルーチン

ここでは、簡単ですが重要な Caché Basic ルーチンについて学習します。ここをクリックすると、そのルーチンが表示されます。このルーチンでは、直角三角形の両辺の長さを元に面積と斜辺を計算します。では、見てみましょう。

SAMPLES>do Run^BASRightTriangle()

Compute the area and hypotenuse of a right triangle
given the lengths of its two sides.

First, choose a unit of measurement.
(i)nches, (f)eet, (m)iles, (c)entimeters, m(e)ters, (k)ilometers: i

Length of side 1: 3 Accepted.
Length of side 2: 4 Accepted.

The area of this triangle is 6 square inches.

The hypotenuse is 5 inches.
SAMPLES>

コードからわかるように、ルーチンには、パブリックとプライベートの両方のサブルーチンと関数があり、また、一般的なコマンドと関数 PrintlnInputReturnExit Sub/DoSelect CaseDo/LoopIf/ElseLeft()Chr()Round()Sqr() が含まれています。

次に、Caché Basic を使用してみましょう。

FeedbackOpens in a new tab