Cancel
Showing results for 
Search instead for 
Did you mean: 

How to call an API from within another API?

Pioneer
Pioneer

Hi,

 

I would like to run many *.BAS files consecutively from a master BAS file. Does anyone know the right method/procedure for this? The feFileProgramRun below does not seem to work as I hoped.

 

rc=App.feFileProgramRun(False,True,True,"D:\XX\renumber.BAS") 

 

Thanks,

Kris

3 REPLIES

Re: How to call an API from within another API?

Phenom
Phenom

Hi,

 

Same here, and I've never taken the time to fully understand the ins and outs of this issue, events, whether a .PRG is required...etc...

However my workaround is to use the VB statement MacroRun:

 

MacroRun "D:\XX\ren​umber.BAS" should work fine.

This is a pretty cool command because you can also pass arguments to it, which opens many possibilities. We have a bunch of "API building blocks" that we can put together to create bigger, more complexe tools.

Checkout the WinWrap help for complete details.

 

For example

C:\tmp\test.BAS =

Sub Main
    Dim App As femap.model
    Set App = feFemap()
    App.feAppMessage(FCM_ERROR,CStr(Command$))
End Sub

  

and then this "API which calls another API":

 

Sub Main
    MacroRun "C:\tmp\test.BAS", "wOOt!"
End Sub

  

AP

Re: How to call an API from within another API?

Legend
Legend

@astrium_tls

 

Very cool! Didn't know it is possible and specially with arguments.

 

Yarko

Re: How to call an API from within another API?

Pioneer
Pioneer

Thanks a lot!

 

This works really well! The script also waits for the macro to finish which is not the case with feFileProgramRun.

 

-Kris