sskoparde
9th February 2016, 06:14
My requirement is
Eg:
1) Get array size . Eg test.arry(10)
2) Accept 10 nos. in array test.array(i)
3) Calculate (Std. deviation.avg,max,min from an array value)
4) display the result (Std. deviation.avg,max,min from array value)

No need of any table. Accept from form and display the result

Sanjay Koparde
9481403217

Ajesh
9th February 2016, 09:34
Generate a Type 4 Session(Without Main Table) for processing the variables.

Get around 10 input fields on your form and declare in your script


long test.array(10)


And on the form Declare each array variable as a separate form field. Like
test.array(0),test.array(1) and so on ...

And on choice cont.process.

Calculate each of your specified definitions.

choice.cont.process:
on.choice:
read.main.table()


function read.main.table()
{

long i,avg,max,min,std,dev

for i=1 to 10
avg = avg + test.array(i)
if test.array(i) > max then
max = test.array(i)
endif
if test.array(i) < min then
min = test.array(i)
endif
endfor
avg = avg/10

}



And if you want you can add display variables on your form like avg,max,min and std.dev(i did not include the calculations for std.dev but i hope you get the drift.)


}