IDEAScripting Tips and Hints
Post for tips and hints on how to use IDEAScript.
Adding a line break to your dialogs
Forums
Here is a trick. If you ever want to diplay some text in a dialog or message box and want to add breaking lines so that the text is not one long paragraph you can use the following:
Dim CrLf as string
Dim msg as string
CrLf = Chr(10) & Chr(13)
msg = "Line 1" & CrLf
- Read more about Adding a line break to your dialogs
- Log in or register to post comments
I have a syntax error in my script but the line looks fine
Forums
I was working on a script that I will hopefully post to the site in the next few days. Tonight I came back to it and it was giving me a syntax error on line 56. Looked at the line and it looked fine, tried it again and the same thing. So I commented out the line and still got the error on line 56. Changed some code and moved the line and the error was still on 56. Then I remembered, I had several dialogs and each of those dialogs has hidden code, so line 56 that it was showing me in the IDEAScript editor isn't actually line 56 it is some other line (yes the edi
Using Regional settings in your script
Forums
I saw a posting at the IDEA web site in which the person was having problems because sometimes the equations used would take a "," and other times it would take a ";". The reason for this is because of the regional settings.
- Read more about Using Regional settings in your script
- 1 comment
- Log in or register to post comments
How to extract the filename from a variable
Forums
Here is a way to extract the filename from a variable that contains the path and filename.
Sub Main
strFilePath = "C:\folder\folder\folder\file.txt"
MsgBox Mid(strFilePath, Len(strFilePath) - InStr(1, iReverse(strFilePath), "\") + 2, InStr(1, iReverse(strFilePath), "\") - 1)
End Sub
- Read more about How to extract the filename from a variable
- Log in or register to post comments
Using the DlgListBoxArray
Forums
The DlgListBoxArray allows you to change the items in a drop list within the dialog. You have a few alternatives when setting up a drop list, you can include an array in the Attached List properties of the drop down tool or you can use the DlgListBoxArray from within the dialog function. Tonight I was creating a dialog and because I usually use the DlgListBoxArray I didn't bother to define an array as part of the Attached List properties, when I tried to retreive the item number it kept coming up as blank. It took me awhile to realize that you need to attach something to t
- Read more about Using the DlgListBoxArray
- Log in or register to post comments
Errors in dialog
Forums
Well I just found something out this morning. You may or may not know that the IDEAScript editor hides the code for the dialog and instead shows a graphic representation of the dialog, which is great but it does have a few problems. I had written some code and unfortunately I had named a dialog component in an incorrect format so I was receiving an error. The problem was that within the editor it was showing the error as being part of the script and not showing the error as part of the dailog. I finally clued in after realizing that no matter what I did to the script
- Read more about Errors in dialog
- Log in or register to post comments
Rounding Up or Ceiling
Forums
IDEA and VB doesn't have a native function to round up or get the ceiling of a number. What I mean is if you have the number 1.2 and you want to round up, if you use round() or int() you would get 1 instead of 2. I found this function on the internet at http://www.xtremevbtalk.com/showthread.php?t=118971 that seems to work. Here is the function that you can place into IDEA.
- Read more about Rounding Up or Ceiling
- Log in or register to post comments
Test to see if an array is empty
Forums
I just posted a snippet that will test to see if an array is empty and return TRUE or FALSE. If you Dim an array such as DIM myArray() as string you haven't initialized it yet, if you test to see if anything is in it IDEA will raise an error. The snippets tests for the error and returns a true or false.
- Read more about Test to see if an array is empty
- Log in or register to post comments
Key Value Extraction Array
Forums
Well I just learned something tonight. The IDEAScript for a key value extraction uses an array to hold all the values to extract. When I was creating the script I assumed that the array was one of string since it was holding text but when I did that the script kept giving me an error when I got to that line. Turns out that when you define the array you either don't tell IDEA what it is or define it as a Variant so it needs to be one of these:
- Read more about Key Value Extraction Array
- 15 comments
- Log in or register to post comments
Use an IDEA field if updating the data directly
Forums
In IDEAScript you can update the data directly in the cell by using the RecordSet and Record objects within IDEA. Usually you would first create the field using the field manipulation functions. If you create a virtual field and then try to do the update through the Record object the script will give an error. You have to instead create an idea field, what I mean instead of selecting virtual numeric, virtual character, etc you would select the numeric, character, etc fields and that will allow you to do the update properly.
- Read more about Use an IDEA field if updating the data directly
- Log in or register to post comments