var v1=new Array();
var v2=new Array();
var op1=new Array();
var op2=new Array();
function myFunction() {
id="1sP9MjhvqCvkSQyRUmiWBMhV050uGt9m7nFtyfGASyXM";
var ex1 = SpreadsheetApp.openById(id);
var sheet = ex1.getSheetByName("data");
for(s=1;s<3;s++){
v1[s]=new Array();
v2[s]=new Array();
}
v1[1][1]=500;
v1[1][2]=-8000;
v1[2][1]=6400;
v1[2][2]=-800;
v2[1][1]=500;
v2[1][2]=6400;
v2[2][1]=-8000;
v2[2][2]=-800;
for(s=1;s<3;s++){
for(sx=1;sx<3;sx++){
sheet.getRange(s+3, sx+2).setValue(v1[s][sx]);
}}
for(s=1;s<3;s++){
for(sx=1;sx<3;sx++){
sheet.getRange(s+7, sx+2).setValue(v2[s][sx]);
}}
t1=0;
for(s1=1;s1<3;s1++){
s2=seek_op2(s1);
sx=seek_op1(s2);
if(sx==s1)t1=s1;
}
t2=0;
if(t1>0)t2=seek_op2(t1);
sheet.getRange(11, 2).setValue(t1);
sheet.getRange(12, 2).setValue(t2);
}
function seek_op1(s2){
var sx;
sx=1;
p1=v1[1][s2];
if(v1[2][s2]>p1)sx=2;
return sx;
}
function seek_op2(s1){
var sx;
sx=1;
p1=v2[s1][1];
if(v2[s1][2]>p1)sx=2;
return sx;
}
最終更新:2016年06月28日 19:01