IDEAScript Questions
Cannot delete folder within script
Forums
Hi Brian,
I'm writing a script that creates a working folder, does a lot of file compilation within that folder, and then moves the resulting two files to a new folder.
Once the results are moved to the new folder I then want to delete the working folder.
As part of the main subroutine I have the folder name defined much earlier in the script as shown below
Set fldrName as String
Set wD as String
wD= CurDir()
- Read more about Cannot delete folder within script
- 13 comments
- Log in or register to post comments
Function to Refresh File Explorer
Forums
I've noticed that whenever I run a script which creates a new database, I have to manually click the "Refresh List" to get the File Explorer to display the new database which was created. Is there a line of code I can put at the end of my script to automatically refresh the File Explorer?
- Read more about Function to Refresh File Explorer
- 2 comments
- Log in or register to post comments
Field type
Forums
Is there a way to check if a field type is numeric or a string? I found the code to check is a field exists but now i need some code to check is the field type is numeric or not.
Function checkIfFieldNameExists(fieldname As String, filename As String) As String
fieldname = UCase(fieldname)
origFieldName = fieldname
Set db = Client.OpenDatabase(Databasename)
Set table = db.TableDef
field_count = table.count
ReDim fieldNames(field_count)
For i = 1 To field_count
- Read more about Field type
- 1 comment
- Log in or register to post comments
Populating TextBoxes with values from an imported database
Forums
I have a macro now that performs extractions and random samples based on a number of user-entered edit boxes on the dialog screen. The user entered data comes from a standardized Excel workbook that contains the proper data in a structured manner. What am I wondering is if there is a way to "import" those values such that the text boxes are essentially filled in with the data contained in the Excel workbook?
Thanks for any information!
Function age
Forums
Hello,
I have a problem with the function @age in Ideascript. When I execute the following code, IDEA crash.
Function DatePiece
Set db = Client.OpenDatabase(dbname)
Set task = db.TableManagement
Set field = db.TableDef.NewField
field.Name = "ECARTDATE"
field.Description = ""
field.Type = WI_VIRT_NUM
Dim a As String
- Read more about Function age
- 13 comments
- Log in or register to post comments
Running a script on multiple databases before appending
Forums
Hi Brian,
I've got two scripts that I'd like to combine to create one process. My goal is be able to categorize each database in a .IDM file (unicode) by appending a field with the first number in each database name before appending all the databases together. Using some other scripts I've found and tweaked, I have the two separate codes I need, but I'm not sure how to put them together. Any help you could provide would be appreciated.
Find the group that exceeds...
Forums
Hello, I have a question regarding IDEAScripting. This is something that I can easily do on SQL but I haven't managed to find a solution for this using IDEA.
Given the sample data on the attached image, I am looking to find a group of transactions, within 5 days from eachother, which sum of amount is above 5000.
For the given data it would be the transactions on the following days:
- Read more about Find the group that exceeds...
- 2 comments
- Log in or register to post comments
Shell function
Forums
Hi all,
I have read some scripts writing about import multiple files and there is a part about Shell function that I am not clear. For example
Function BrowseFolder()
Dim oFolder, oFolderItem
Dim oPath, oShell, strPath
Dim msg As String
Set oShell = CreateObject( "Shell.Application" )
Set oFolder = oShell.Namespace(17)
Set oFolderItem = oFolder.Self
- Read more about Shell function
- 1 comment
- Log in or register to post comments
Import file and append to database in one go
Forums
Hi all,
I need to import a very large number of files and append them into one master database.
I have written a simple script to import the files, and another simple scripte to append them into one database. So, I can just run the two scripts one after the other and be done.
However, due to the very large number of files (>500k), I am a bit worried about performance: IDEA needs to 'open-read-write-close' the files twice: first for the import-routine and then for the append-routine.
- Read more about Import file and append to database in one go
- 8 comments
- Log in or register to post comments
Loop multiple exports
Forums
I got like 24 export to excel files, i want to loop the call function with export1, export2 until export 24. When i use the code below i get the result in a message box correct but with the call function i get an error unexpected array. Do i miss something?
Dim Q As String
Dim Func As String
Q = 24
For i = 1 To Q
Func = "Export" & i
'MsgBox Func
Call Func
Client.CloseAll
- Read more about Loop multiple exports
- 1 comment
- Log in or register to post comments