Skip to main content

IDEAScript Questions

Create text file containing field modifications

Hi,
Is it possible to create an IDEA script generating text file in which list down all field modifications and new field creations?
For example, the field "Date" when imported will be renamed to "SaleDate" and this field will be used to create a new field called "FinalDate" later
 

Excel

Is it possible to export multiply IMD files to one Excel files in different worksheet tabs?
And is there a good guide on how to use VBA Excel? I want to add more worksheets tabs and add text to the diffrent worksheet tabs. I got this far with Google:
 
 
Sub Main
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = False
ExcelSheet.Application.Cells(1, 1).Value = "This is column A, row 1"
ExcelSheet.SaveAs "H:\!OHW\IDEA\Test Project 01 (9999990)\Exports.ILB\TEST.xlsx"

Indicex/index

I got a script to create an index, but IDEA don't set the index, the default is no index, is there a way to force IDEA to use a specific index?
 
 
Function IndexDatabase(DatabaseToBeOpened As String, FieldToBeIndexed As String, IndexKey As String)
Set db = Client.OpenDatabase(DatabaseToBeOpened)
Set task = db.Index
task.AddKey FieldToBeIndexed, IndexKey
task.Index FALSE
Client.CloseDatabase(DatabaseToBeOpened)
Set task = Nothing
Set db = Nothing
End Function

Using a global variable defined Macro script 1 and using the same variable value in Macro script2

Hi All & Brian,
I have a doubt regarding declaring a variable in one macro script and then using the variable's value defined by the end user in the first macro in the second macro. To give you more perspective this is the code i am working on:
 
Macro 1: 
Option Explicit
Global sFilename As String

Summarization

Hi, i created a piece of script in which all the parameters are set in the call line. Now i run into the problem that sometimes with the summarization function there a one or more fields to summarize or to total on. I could create an array outside the function and let i unpack within the function with For i to next. But is there a way to create the array within the call line?

Check if field exists

Hi, in the script of generate an audit number is a function to check if the fields exists.
http://ideascripting.com/ideascript/generate-audit-number
I want to use that function to create a indicator if the fields exists (variabele "Result"). To reset it at the start of the script I set it to unkown. I placed a line to set Result to "Exists" afters TempFieldname = sTempFieldname & "1". But i can't find the right place for the line Result = "Not exists". 

Set record number in a field

I got a bank transaction file in which only the bank statement number is a field. If i want to join this file with the administration i need to have the row/record number in a field so i can create a key field on which to join on. 
Question 1 is how can i create a field with the row number and question 2 is how do i make it that when the field with the bank statement number changes the row number starts with 1. In the perfect world it should looks like this:
Bank statement nr.      Row number

Array

Hi, i want to use the fieldsname which i placed in an array to check for each field if it is numeric or not. But for some reason it won't accept the array fieldname to get the field and check if it is numeric or not. Anyone who can help me?
 
------------------------------------------
 Option Explicit
 
Dim A1 As Integer
Dim A2 As Integer
Dim i As Integer
 
Dim DbLetter As String 
Dim Q1 As Integer
Dim Q2 As Integer
 
Dim db As database
Dim table As table