如何比较两个数字提取

时间:2016-07-10 16:22:33

标签: imacros

我正在从网页中提取数字,我想比较它们,如果 数字超过[前一个,然后在iimDispaly()中显示,否则如果它低于跳过,我在这里做了但是找不到解决方案。

for(var i = 1; i <= 13; i++) {

for(var j = 3; j<=33; j+=3 ) {

iimPlayCode('TAG POS='+j+' TYPE=DIV ATTR=CLASS:"group_row_labeled" EXTRACT=TXT')
var res = iimGetLastExtract();
var result = res.replace(/[а-z]/g, '');

if(j==3) {
    var firstRes = result;
}

if(result => firstRes) {
    iimDisplay("Highest Number: " + result)
}
}
}

1 个答案:

答案 0 :(得分:1)

复制&amp;粘贴以下代码并尝试播放它:

&sql(SELECT *,%ID INTO :tflds()   
        FROM Sample.Person )
   IF SQLCODE=0 {
     SET firstflds=14
     FOR i=0:1:firstflds { 
       IF $DATA(tflds(i)) {
       WRITE "field ",i," = ",tflds(i),! }
     } }
   ELSE {WRITE "SQLCODE error=",SQLCODE,! }