Skip to main content

How to use IDEA equations in scripts and custom functions

IDEA has over 100 functions that can be used in the equation editor.  The program has functions to manipulate character, numeric and time fields to name just a few.  You can also access all these functions in IDEAScript and Custom Functions by putting an i in front of the function.  So in the equation editor you use the @mid() function, if you wish to use it in a script or a custom function put an i in front of it like imid() to access it.

macroKV Tue, 01/21/2014 - 08:30

I tried this for the reverse function but it did not work. the Syntax I used is iReverse(Inputstring). Has anybody been successful with ireverse?

Brian Element Tue, 01/21/2014 - 11:21

I just tried this script and it works. If I enter abcde it will retrun edcba. I am at work right now using V8 of IDEA so I haven't tested this to see if it works on V9 but it should.

Sub Main

Dim sString As String

sString = InputBox("Please enter a string")

sString = iReverse(sString)

MsgBox sString


End Sub

 

macroKV Thu, 01/23/2014 - 10:27

Your Suggestion works. I'm still using V8.5. Thanks a lot!

gaban Mon, 06/09/2014 - 04:29

I am using IDEA v 9.2, I can't use "iSimilarPhrase" function in script. But I can use "iReverse". Look like v 9.2 does not support all new functions to use in script.

MartinSaumure Tue, 06/17/2014 - 14:18

Hi,
This was useful to me, I'm using Idea v8.05 and I simply used the following synthax:
field.Equation = "@strip(column1)"
Needless to say that this makes my scripts very difficult to debug since the equation had to be on one line.
I'll now attempt to change the existing script I have to the "iFunction" synthax, which is a must before I can improve it.
Many thanks!
Marty

Brian Element Tue, 06/17/2014 - 14:28

In reply to by MartinSaumure

Hi Marty, and welcome to the site.

You wouldn't use the "iFunction syntax" in any formula that would use the equation editor.  The "iFunctions" allow you to access most of the functions that are used in the equation editor directly in calculations that you peform within your scripts.  One I use fairly often is the iReplace as the IDEAScript version of visual basic doesn't have an easy way to perform this function.

So let me know how your update works.

Brian

robgentile Wed, 09/24/2014 - 11:31

The "i" for "@" substitution feature in scripts is very useful! However, I just ran into another case (SimpleSplit) that fails, though Split works fine. 
Does anyone happen to have a list of ifunctions that don't work? 

Brian Element Wed, 09/24/2014 - 12:36

Hi Rob, my guess would be that when they updated to version 9 they didn't update the functions for ideascript.  SimpleSplit is a new function in V9 so that is probably why it doesn't work whereas Split exists in version 8.  So I don't have a list but I think most functions will work except possibly the new ones that were added in V9.