Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let type;
- let arr;
- let a0;let a1;let a2;let a3;let a4;let a5;let a6;let a7;let a8;let a9;
- function Arr_Init(n,v){
- let a;
- alternative(type)
- case('V'){ a=""; a0=v; }
- case('v'){ a=""; ascent(i in 0..n){ SetAVar(i,v); } }
- case('n'){ a=[]; loop(n){a=a~[v];} }
- case('o'){
- a=""; ascent(i in 0..n){ Obj_SetValue(a,itoa(i),v); }
- Obj_SetValue(a,"length",n);
- }
- case('c'){
- a="arr"~itoa(GetNextHash); ascent(i in 0..n){ SetCommonData(a~itoa(i),v); }
- SetCommonData(a~"length",n);
- }
- case('a'){
- a="arr"~itoa(GetNextHash);
- if(!IsCommonDataAreaExists(a)){ CreateCommonDataArea(a); } else { ClearAreaCommonData(a); }
- ascent(i in 0..n){ SetAreaCommonData(a,itoa(i),v); }
- SetAreaCommonData(a,"length",n);
- }
- return a;
- }
- function Arr_Set(a,i,v){
- alternative(type)
- case('V'){ a0=v; }
- case('v'){ SetAVar(i,v); }
- case('n'){ arr[i] = v; } //cheating a bit
- case('o'){ Obj_SetValue(a,itoa(i),v); }
- case('c'){ SetCommonData(a~itoa(i),v); }
- case('a'){ SetAreaCommonData(a,itoa(i),v); }
- }
- function Arr_Get(a,i){
- alternative(type)
- case('V'){ return a0; }
- case('v'){ return GetAVar(i); }
- case('n'){ return a[i]; }
- case('o'){ return Obj_GetValue(a,itoa(i)); }
- case('c'){ return GetCommonData(a~itoa(i),NULL); }
- case('a'){ return GetAreaCommonData(a,itoa(i),NULL); }
- }
- function Arr_Length(a){
- alternative(type)
- case('n'){ return length(a); }
- case('o'){ return Obj_GetValue(a,"length"); }
- case('c'){ return GetCommonData(a~"length",0); }
- case('a'){ return GetAreaCommonData(a,"length",0); }
- }
- function GetAVar(i){
- alternative(i)
- case(0){return a0;}case(1){return a1;}case(2){return a2;}case(3){return a3;}case(4){return a4;}case(5){return a5;}case(6){return a6;}case(7){return a7;}case(8){return a8;}case(9){return a9;}
- }
- function SetAVar(i,v){
- alternative(i)
- case(0){a0=v;}case(1){a1=v;}case(2){a2=v;}case(3){a3=v;}case(4){a4=v;}case(5){a5=v;}case(6){a6=v;}case(7){a7=v;}case(8){a8=v;}case(9){a9=v;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement