Skip to main content

IDEAScript Questions

Check if a field is already there

Hi everyone,
 
is there any way to check whether a field is already contained in a database?
I want to check if a field is there and if not it appends the field. I tried table.getField, but this results in an error.
 
Here is the part of my code I mean:
Dim table As table
Dim field As field Set db = Client.OpenDatabase (dbname)
Set task = db.TableManagement
Set table = db.TableDef
 
Set field = table.getField("DUMMY_NAME") - This will result in an error if the field is not there

correct Syntax of Input

Hi,
I came across an inconsistency in the scripting Doku of IDEA 8.5 (in german)
a) Objectcatalog : Input[$](Chars As Long, #FileNum As Integer )
b) Tooltip : Input(By Val Number as Integer, By Val FileNumber as Integer) As String
I get the error message:
 
'Error in Line 41 -  Overflow
 
Line 41 >> Contents2 = Input(Lange2, Filenum)

delete a record from a Database

Hi,
I would like to add or remove records from an IDEA Database. That Data is used for Comparison and so it's OK to edit it. My Comments is in German but the Code works a bit. I ask the user to supply a Numer (NR_V) and then "delete" that record. Actually it is not deleted but it is "cleared". The line is empty then. I close an re-open the database to invoke a GUI update, then I extract the with NR_V >= 1 th get rid of the one cleared line.
I have 2 Problems:
a) My script only works one time. Maybe I need to re-index??? How can I do that?

Export to Excel Quickly?

Hello Everyone,
I use IDEA frequantly and our end product always has to be in excel file. Is there any quick script I could put together which exports the currently active database into an excel spreadsheet on my computer without any dialog boxes? I would like the xlsx file to just retain the name of the active database open (.imb file). I recorded a scripted, but honestly, am not very good with scripting. 
Could someone help me to modify it? I feel like 85% of the code is already there.
<code>
Sub Main

Error 52 "Due to an internal error..."

Hi there,
Firstly, I've got a huuuuuuuuuge script here (11k+ lines of code) so I will not post the whole in this thread. ;)
Anyway, the problem, that I've got with my script, that I randomly get a "Errornumber: 52,"Due to an internal error, the Project Overview information for this task was not recorded."". Lets say, I will run the script five times, three out of this five times, work perfectly, one throws the mentiond error, pretty often followed by a "Bad file name or number", and the other time simply crashes IDEA.

Using multiple scripts

Hi,
I have another question about scripting. I created a bunch of small scripts that check the dataset for repetition or missing information and so on. Afterwards I integrated some of the scripts into a different larger script, which runs about 3-5 of my initial small scripts. I called those integrated scripts "routines", which we will use to do a certain audit procedures from our audit plan.
As I create more and more smaller scripts I am in danger of losing track of where I integrated them into the routines.