Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Simple math within an elog form, posted by Steve Jones on Tue Apr 4 06:18:18 2006 
    icon2.gif   Re: Simple math within an elog form, posted by Stefan Ritt on Tue Apr 4 08:15:29 2006 
       icon2.gif   Re: Simple math within an elog form, posted by Steve Jones on Wed Apr 5 00:00:14 2006 
          icon2.gif   Re: Simple math within an elog form, posted by Stefan Ritt on Wed Apr 5 10:07:59 2006 
             icon2.gif   Re: Simple math within an elog form, posted by Steve Jones on Wed Apr 5 13:50:14 2006 
                icon14.gif   Re: Simple math within an elog form, posted by Steve Jones on Wed Apr 5 18:56:48 2006 
Message ID: 1792     Entry time: Wed Apr 5 00:00:14 2006     In reply to: 1790     Reply to this: 1793
Icon: Reply  Author: Steve Jones  Author Email: steve.jones@freescale.com 
Category: Request  OS:   ELOG Version: 2.6.1 
Subject: Re: Simple math within an elog form 

Stefan Ritt wrote:

Steve Jones wrote:
This may sound a little strange but I am trying to determine if it is possible to create a series of attributes that may be assigned an integer value via OPTIONS, and then take the selected values and perform some simple math and display the result.


This item is already on the wishlist, so I added your vote there. But due to my workload, it will certainly not be implemented in the next few weeks.



Quote:

Ok, understood. So instead I am trying to use $shell and am running into a problem
##################################################
# Define Risk1
#
Options Risk1 = 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 


##################################################
# Define Risk2
#
Options Risk2 = 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 

##################################################
# Define Risk2
#
Options Risk3 = 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 

##################################################
# Define TotalRisk
#
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)
#Subst TotalRisk = $shell(gawk 'BEGIN{ print $Risk1 + $Risk2 + $Risk3 }' )
#Subst TotalRisk = $shell(uname -a)

What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code?
ELOG V3.1.5-fe60aaf