Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Please Help : Interprete these lines.
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 24th February 06:25
rotuacdp
External User
 
Posts: 1
Default Please Help : Interprete these lines.



Hello,
I have such problem on understanding these lines :

iSum[iIdx,i]+=(iTmp>0 && iTmp<20*iTmpO[iIdx,i])?iTmp*6:0;

What does it mean ?

and also about this line,
As far as I know in awk, if I want to know the value of a cell on a array,
I can directly do this : a = arr[x]
I just don't understand why on this line above have to use $(arrPos[i]) ?
does it mean direct to another variable ??

iTmp=$(arrPos[i])-iOld[iIdx,i];

Any comments will be highly appreciated.
Thanks.
  Reply With Quote


  sponsored links


2 24th February 06:25
kasal
External User
 
Posts: 1
Default Please Help : Interprete these lines.



Hello,


it's the same as:
if ((iTmp > 0) && (iTmp < 20 * iTmpO[iIdx,i]))
k = iTmp * 6
else
k = 0
iSum[iIdx,i] = iSum[iIdx,i] + k
Does this help?


As you might know, $1 means the first field of the current record,
$5 is the fifth one, $k is the k-th one and $(k+1) is the (k+1)-th one.
You may print the sixth field this way:
k = 3; print $(2 * k)

Back to that line, it's equvalent to:
j = arrPos[i]
iTmp = $j - iOld[iIdx,i]

HTH,
Stepan Kasal
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666