Loop for Functions

4 posts / 0 new
Last post
Torsten Reifegerste
Offline
Joined: 08/06/2021 - 14:18
Loop for Functions

Hello,
this is the first time i am writing in this forum, but i have already a lot of help from reading it. Now i m not getting any further.
 
It is best if i describe the problem first.
 
I want to split a database using the key extraction. Then i would like to create a pivot table, for example, in all the extracted databases. Since the database names can vary in number and naming due the keyfield extraction, a loop that runs through all files with the prefix of the extraction made sense to me.
I found a script for the extraction (KeyExtraction_Test.iss) and the Loop (Function_Loop_Test.iss) here in the forum and adapted it to my needs. They work together via ClientRunIDEAScript and individually for themselve in the main folder from IDEA.
 
My Problem now is if the Splittingfiles are not in the main folder, the loop macro no longer works. An invalid argument or procedure error on line 33 ist thrown.
 
importname = Right (ffile, firstbackspacenum -1)
 
I think the Problem is the definition of the ffile and the Path argument.
 
ffile = Dir $ (path & "Test*." & "imd")
 
Unfortunately, i am at the end of my game here. Can someone help me here so that the Loop can also work in the higher-level folders?
And how it be possible to integrate both scripts into one overall script and not run via ClientRunIDEAScript? Here i have Problems to set the right Dim's and so on. In the past i was able to integrate scripts into my macros without any problems. But never before i have Scripts with Option Explicit and Public Files. Which may cause the problems with the integration.
 
Thanks a lot for Help,
Torsten

Torsten Reifegerste
Offline
Joined: 08/06/2021 - 14:18

Hello,
 
i find a Solution for myself through Forum :)
 
Thx
Torsten

Brian Element's picture
Brian Element
Online
Joined: 07/11/2012 - 19:57

Hi Torsten,

That is good to hear that you solved it yourself.  Thanks for letting us know.

Torsten Reifegerste
Offline
Joined: 08/06/2021 - 14:18

yes, i found another script from you, which take the folder structure in a different way.
https://www.ideascripting.com/comment/2277#comment-2277
 
thx again