# Caché Basic

Caché Basic is a historical query language created in InterSystems_Caché.

NaNYears Old | 1,000Users | 0Jobs |

- Caché Basic ranks in the bottom 50% of languages
- Caché Basic first appeared in InterSystems_Caché
- I have 14 facts about Caché Basic. just email me if you need more.

### Example code from the web:

' RightTriangle compute area and hypotenuse of a right triangle ' this routine contains examples of Cache Basic features */ Sub Run() println "Compute the area and hypotenuse of a right triangle" println "given the lengths of its two sides." println println "First, choose a unit of measurement. " input "(i)nches, (f)eet, (m)iles, " _ , "(c)entimeters, m(e)ters, (k)ilometers: ", units println ' translate units to a full word select case left(units, 1) case "i" units = "inches" case "f" units = "feet" case "m" units = "miles" case "c" units = "centimeters" case "e" units = "meters" case "k" units = "kilometers" case else units = "units" end select do println input "Length of side 1: ", side1 if (side1) = "" then exit do loop while IsNegative( side1 ) if (side1 = "") then exit sub do println input "Length of side 2: ", side2 if (side2) = "" then exit do loop while IsNegative( side2 ) if (side2 = "") then exit sub Compute(units, side1, side2) end sub public function IsNegative(ByVal num As %String) As %Boolean ' is num negative? ' check in range "1" through "9" if (num < chr(49)) or (num > chr(57)) then print " Enter a positive number." return True else print " Accepted." return False end if end function private function Compute(ByVal units As %String, _ ByVal A As %Integer, _ ByVal B As %Integer) ' compute and display area and hypotenuse area = round((( A * B ) / 2), 2) hypot = round(sqr(( A ^ 2 ) + ( B ^ 2 )), 2) println : println println "The area of this triangle is ", area, " square ", units, "." println println "The hypotenuse is ", hypot, " ", units, "." end functionEdit

Last updated February 11th, 2019