![]() |
![]() |
How Simple To Write Is An MV-DBMS Program?
We think that one of the ways to convince you of the flexibility of MV-DBMS is to show you a couple of simple programs written using the BASIC language used in all MV-DBMS environments. The program samples are written to perform "work" not create pretty pictures. But once you understand that constructive work can be easily executed, you will have fewer concerns about designing systems ergonomically tailored to the needs of users, without loss of core functionality.
Prime Numbers Computation
Prime numbers are extremely important in MV-DBMS because data is "hashed" into linear groups, rather than being being treated as a monolithic string. This unique technique makes data rapidly accessible, and suitable for variable length storage, without the need to search the entire file-system to find it.
As with all programs, the important point to remember is the core rule: prime numbers are not divisible by any other number than themselves or 1.
x=''; *vars change alpha/num state on-demand tbl='' am=char(254); *char(254) is a multi-value separator print "1"; *1 is a special rule number 100 x=x+1 if x>1000 then stop;*end at desired limit y=dcount(table,am); *quantity of primes; =0 if null for i=1 to y if (x/tbl<i>)=int(x/tbl<i>) or x=1 then go 100;*#prime next i table<y+1>=x print x go 100
In looking at the above sample, note how the variable table can be of indefinite length. It is this flexibility which really simplifies the problem. Computational time is not grossly wasted by the simple addition of "1," but rather by the need to build a sound set of tests which reduce the number of divisions. In this sample, the only accumulated tests are of prime numbers, since any non-prime number will always be a combination of primes.
Most program languages lack an easy way to conveniently build ad hoc indefinite length tables, and so would require 20 to 50 statements to complete the same computation.
![]() |
![]() |