Intuitive Grid Codes

esProc provides a grid user interface similar to excel which enables users to perform codes in a grid from left to right, top to bottom. Each cell has unique and naturally named coordinates with column and row number, so users can reference the calculation results of other cells conveniently through the coordinates for further processing.

The cell-style interface makes codes presented with natural formatting, natural alignment, naturally indent and thus makes typesetting unnecessary. The grid style codes not only makes the code neat and clean, but also offers users a intuitive way to organize and arrange the relationship between the computation steps, and thus easier to pierce the heart of a problem and solve complicated problems.

Natural step by step computation

  • Cells can hold the result and is stepwise by nature.
  • The intermediate result can be referenced by row and column numbers. This is much simpler than the
    traditional scripts.
  • Stepwise computation is not supported in SQL, and thus the computation complexity is increased.
A
1 =db.query(“select * from Employee”)
2
=A1.select(Gender==”Male”)
Male employees
3
=A1.select(Birthday>=date(“1970-01-01”))
Employees born in and after 1970
4
=A2^A3
Male employees born in and after 1970
       In the expression A1.select(Gender==”Male”) of cell A2, you can use A1 to directly reference the result of previous step. In the expression A2^A3 of cell A4, the A2 and A3 is directly referenced with the cell name.
Complete process control

  • Complete flow control, including the branch judgment and loop statement, nested multiple branches, and multiple recursions.
  • The logic control is implemented with a language similar to BASIC. Compared with JAVA/C++ and other high level languages, the language of esProc requires a far lower knowledge level to start learning.
A B C
1
[35,23,41,52,98,32,56,76,81,31]
Bubble sort algorithm
2 for =A1.pselect(~<~[1]) External loop
3 if B2==0
break
Switch out of the loop
4 for B2>0 =A1(B2) Swap the menber during inner loop
5 >A1(B2)=A1(B2+1)
6 >A1(B2+1)=C4
7 >B2=A1.pselect(~<~[1],B2+1)
Neat and clear codes

  • esProc cells are of the natural delimiters and indentions
  • With the cell as natural delimiter, the alignment of constants is effortless
  • With the cell as natural indention, the loop/branch statements have got the natural and clear scope
  • The cell-style code enables a more clear and easy-to-read multi-nest, you will never get caught up in an awkward situation of messy levels of nesting (such as the typical bracket pitfalls of }}}} in Java)
A B C D
1 Mike Male 20 3000
2 Lucy Female 21 3200
3 Jake Male 29 4000
4 David Male 24 3400
5 =create(Name,Gender,Age,Salary).record([A1:D4])
6 =0 =0
7
for A5
The loop body is marked with red rectangle
8
if A7.Gender==”Male” && A7.Age>25
The statements marked with green rectangle is executed when the condition of the if statement is true
9 >A6=A6+A7.Salary Total salary of male employees above 25 years old
10
else
The statements marked with blue rectangle are executed when the condition of the if statement is not true
11 >B6=B6+1 Total salary of other employees
Realtime Computing
With esProc, you can code, run, and return the result instantly. Therefore, the interactive analysis can be implemented easily.

A B
1 Jonney Deep Robert Denim
2
=file(“..\\txt\\Movie.txt”).import@t()
3
=A2.select(Actor==A1).(Movie)