Skip to main content

Suggestions for IDEAScript snippets

Description

Suggestion for useful functions that could be inserted into an IDEAScript

How to cut a string into individual words

 
Hi,
 
maybe someone needs something like this.
 
Here is a short Example:
 


Sub Main

Dim sOriginalText As String
Dim sOriginalText_C As String
Dim sWord As String
Dim iNumBlank As Integer

sOriginalText = ""
sOriginalText_C = ""
sWord = ""
iNumBlank = 0

sOriginalText = "42 : , ; .. How many roads must a man walk down Before you Call him a man How many seas must a white dove sail Before she sleeps In the sand"

Date Picker

I just added a date picker to the snippet section.   One limitation of the IDEAScript dialog is that there is no date picker.  I had recently seen a comment on the IDEA forum that they had a script for one but for whatever reason had not posted it in their script section.  So I decided to try and create one of my own.  I think the final product is not bad:

Date Picker

put the puzzels together

hi folks,
i will show you how to put the iss puzzels together..well most of you will already done this, but for the new ideascripting folks it
is maybe a inspiration...

if you work each time with the same datastructure i show you how to import csv files automatically into idea and how to organize
some of your scripts in a comfortable way...

in this example i have one masterfile and two detailfiles. the file are from type csv. of course you need for every datafile
a record definition file (rdf).

text cleanup

what does the script do?

you can choose a idea table from your working directory and than choose a char column from this table.
the script will create a new column (you have to give it a name and datalength) in the table.
the new column is prepared according to a self-assigned formula.

maybe the dialog e.g. could be extended with option buttons for different formulas...

in the example a very easy formula is used...

happy coding...
chris

get error messages or notes persistent

if you are testing macros in idea or if a macro is rolled out you maybe want
error messages an things like this persistent.

also if you have messages in your script that should inform the user what is going on
you maybe do not want a showstopper like a msgbox...

so just try something like this:

@brian:
-------
please format the code ;)


main
----

Sub Main

'declaration
Dim a As Integer
Dim b As Integer

a = 0
b = 1