© serviceprofessionalgmbh

The macro adds all numeric contents of the equivalent area and returns the sum. The area is defined via the start parameter for top left and bottom right.

/* REXX * EDIT MACRO *************************************************/
/*                                                                   */
/* Macroname.: $SUM                                                  */
/*                                                                   */
address isredit
"macro (oben,links,unten,rechts)"
sum=0
do cnt=oben to unten
   "(zeile) = line" cnt
   bereich=substr(zeile,links,rechts-links+1)
   if datatype(bereich) = 'NUM' then sum=sum + bereich
end
befehl="line_after" unten "= noteline '"right(sum,rechts)"'"
interpret 'address isredit "'befehl'"'
zedsmsg=sum
zedlmsg="Ergebnis der Summenbildung Zeile" oben "Spalte" links
zedlmsg=zedlmsg "bis Zeile" unten "Spalte" rechts "ist" sum
address ispexec "setmsg msg(isrz000)"
exit
back to Edit Macros