How to get the List of dataset loaded for simulation

Use this forum to post Vensim related questions.
Post Reply
Paul Anim
Junior Member
Posts: 19
Joined: Thu Jun 09, 2011 12:19 am

How to get the List of dataset loaded for simulation

Post by Paul Anim »

Hi All,
I am using MENU>LOAD_RUN|? in a vb.net program to open the dialog box to load the datasets.
Below is the sample Vb.net code I used

Code: Select all

 Dim result As Object
 result = vensim_command("MENU>LOAD_RUN|?")
I want to know how to get the (names or counts)of the list of loaded datasets for the simulation.
Thanks
Administrator
Super Administrator
Posts: 4597
Joined: Wed Mar 05, 2003 3:10 am

Re: How to get the List of dataset loaded for simulation

Post by Administrator »

Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Paul Anim
Junior Member
Posts: 19
Joined: Thu Jun 09, 2011 12:19 am

Re: How to get the List of dataset loaded for simulation

Post by Paul Anim »

Thanks very much.
I am having a difficulty on how to call the vensim_get_info function especially on how to supply the variable(s) to the function.
Below is my sample code

Code: Select all

Dim testresult As Object
        Dim testbuf As String = ""

        testresult = vensim_get_info(10, testbuf, 500)
Administrator
Super Administrator
Posts: 4597
Joined: Wed Mar 05, 2003 3:10 am

Re: How to get the List of dataset loaded for simulation

Post by Administrator »

Try the following. The string you are passing to Vensim was zero length ("") but you are telling Vensim that it is 500 chars long.

Code: Select all

Public Declare Function vensim_get_info Lib "vendll32.dll" (ByVal infowanted As Short, ByVal buf$, ByVal maxbuflen As Short) As Short

Code: Select all

        Dim nMaxStringLen As Long
        nMaxStringLen = 500

        Dim sBuffer As String
        sBuffer = New String(" ", nMaxStringLen)

        nResult = vensim_get_info(10, sBuffer, nMaxStringLen)
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Paul Anim
Junior Member
Posts: 19
Joined: Thu Jun 09, 2011 12:19 am

Re: How to get the List of dataset loaded for simulation

Post by Paul Anim »

thanks alot for your help
Post Reply