SHOWVAR SUBSCRPTED VARIABLES

Use this forum to post Vensim related questions.
Post Reply
Chaboud Christian
Junior Member
Posts: 7
Joined: Tue Sep 22, 2020 1:06 pm
Vensim version: DSS

SHOWVAR SUBSCRPTED VARIABLES

Post by Chaboud Christian »

Good evening,

I'm using Vensim DSS 8.1.1 for windows.

I have made a Venapp using the SHOWVAR command to show variables values.

For subscripted variables it works well when asking to show values for specified values of the subscript.
But It doesn't work when using the subscript name in the SHOWVAR command.

for instance if the subscrpt s has to values S1,S1, and the subscripted variable is A

SHOWVAR A[s1] or showvar[s2] are OK but SHOWVAR A[s] gives no result.

Thanks four your Help
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: SHOWVAR SUBSCRPTED VARIABLES

Post by Administrator »

Chaboud Christian wrote: Wed Feb 03, 2021 2:43 pm SHOWVAR A[s1] or showvar[s2] are OK but SHOWVAR A[s] gives no result.
The help says that it should work and display the first subscript element selected. Do you have any subscripts selected?
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
Chaboud Christian
Junior Member
Posts: 7
Joined: Tue Sep 22, 2020 1:06 pm
Vensim version: DSS

Re: SHOWVAR SUBSCRPTED VARIABLES

Post by Chaboud Christian »

I did select subscripts ...I did succesfully use that command with an older vensim version....
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: SHOWVAR SUBSCRPTED VARIABLES

Post by tomfid »

If no element is selected, it should show the first element, so this sounds like a bug. But we can't easily judge without a test case. Can you share the code for the screen?
Chaboud Christian
Junior Member
Posts: 7
Joined: Tue Sep 22, 2020 1:06 pm
Vensim version: DSS

Re: SHOWVAR SUBSCRPTED VARIABLES

Post by Chaboud Christian »

Ok, I send you the following elements showing clearly yhe problem :
a small vensim program (test.mdl) and a Venapp using it (test.vcd)
SHOWVAR is used in the OUTPOUT1 view of test.vcd
Showvar[a1] and Showvar[a1] : ok !
Whowvar [a] : error !


***********************************************************************
Text Code for Vensim model (test.mdl)

{UTF-8}
a:
a1,a2
~
~ |

X[a1]=
sin(Time) ~~|
X[a2]=
cos(Time)
~
~ |

********************************************************
.Control
********************************************************~
Simulation Control Parameters
|

FINAL TIME = 100
~ Month
~ The final time for the simulation.
|

INITIAL TIME = 0
~ Month
~ The initial time for the simulation.
|

SAVEPER =
TIME STEP
~ Month [0,?]
~ The frequency with which output is stored.
|

TIME STEP = 0.125
~ Month [0,?]
~ The time step for the simulation.
|

\\\---/// Sketch information - do not modify anything except names
V300 Do not put anything below this section - it will be ignored
*View 1
$192-192-192,0,Times New Roman|12||0-0-0|0-0-0|0-0-255|-1--1--1|-1--1--1|96,96,100,0
10,1,X,315,162,8,11,8,3,0,0,0,0,0,0,0,0,0,0,0,0
10,2,Time,315,192,26,11,8,2,0,3,-1,0,0,0,128-128-128,0-0-0,|0||128-128-128,0,0,0,0,0,0
1,3,2,1,0,0,0,0,0,64,0,-1--1--1,,1|(315,184)|
///---\\\
:L<%^E!@
1:test.vdfx
9:Current
15:0,0,0,0,0,0
19:100,0
27:0,
34:0,
42:1
72:0
73:0
4:Time
5:X[a]
35:Date
36:YYYY-MM-DD
37:2000
38:1
39:1
40:2
41:0
76:0
77:0
78:0
79:0
80:0
81:0
24:0
25:100
26:100
75:
43:
6:a1
6:a2

****************************************************************************
Text Code for Venapp test.vcd

! Venapp Modeling CRABE
! the exclamation mark marks something as a comment (the item is not functional in the venapp)
! remove the exclamation marks (below) to restore functionality
! This template is described in Chapter 5 of the Vensim DSS Reference Supplement
!
:SCREEN WELCOME
SCREENFONT,Times New Roman|12|B|0-0-0|-1--1--1
PIXELPOS,0
COMMAND,,,,,,,,"SPECIAL>LOADMODEL|test.mdl"
COMMAND,,,,,,,,"SPECIAL>CLEARRUNS"
COMMAND,,,,,,,,"SETTING>SHOWWARNING|0"
TEXTONLY,"CORECRAB",50,5,,,C||36|B|255-0-0,,"",
TEXTONLY,"Christian Chaboud",0,58,100,,C||14||128-0-128|,,"",
TEXTONLY,"Bioéconomiste des pêches",0,62,100,,C||14||128-0-128|,,"",
TEXTONLY,"2020",0,66,100,,C||14||128-0-128|,,"",
! TEXTONLY,"Appuyer sur une touche pour continuer",0,84,100,0,C||14|||,
BUTTON,"Continuer",50,90,45,5,C,,"",MAIN
ANYKEY,"",0,0,0,0,0,,,MAIN
TEXTONLY,"CORECRAB",50,5,,,C||36|B|255-0-0,,"",
TEXTONLY,"Simulation bioéconomique d'une pêcherie de crabe",50,21,,,C|Times New Roman|36|B|255-0-0,,"",
!
:SCREEN MAIN
SCREENFONT,Times New Roman|12|B|0-0-0|-1--1--1
PIXELPOS,0
TEXTONLY,"MODELE CRABE",50,5,0,0,C|Times New Roman|30|B|200-55-0,
TEXTONLY,"Menu principal",50,18,,,C|Arial|24|B|0-0-255,,"",
RECTANGLE,"",19,25,62,60,C|Times New Roman|12||0-0-255,,,
BUTTON,"Simuler le modèle",50,40,50,6,C,,"SPECIAL>CLEARRUNS|&SIMULATE>READRUNCHG|&SIMULATE>RUNNAME|? Nom d\
u fichier de sortie",RUNNING
! BUTTON,"? Help ?",50,80,40,6,C,,SPECIAL>WINHELP|VRHELP.HLP|1100
BUTTON,"Sortie",50,90,40,6,C,Qq,"SPECIAL>ASKYESNO|VOULEZ-VOUS VRAIMENT QUITTER?&MENU>EXIT",
!
:SCREEN RUNNING
SCREENFONT,Times New Roman|12|B|0-0-0|-1--1--1
PIXELPOS,0
COMMAND,,,,,,,,"MENU>RUN1|O"
COMMAND,,,,,,,,"SPECIAL>SETWBITEM|Population"
CLOSESCREEN,"",0,0,,,,,"",OUTPUT1
!
:SCREEN OUTPUT1
SCREENFONT,Times New Roman|12|B|0-0-0|-1--1--1
PIXELPOS,0
!!BUTTON,"Modify and Rerun Last Scenario",75,82,0,6,L,,SIMULATE>READRUNCHG|!,SETUPSIM
SHOWVAR,"X[a]",11,16,,,,,"",
TEXTONLY,"X[a]",6,16,0,0,,,,
SHOWVAR,"X[a1]",11,22,,,,,"",
TEXTONLY,"X[a1]",6,22,,,,,"",
SHOWVAR,"X[a2]",11,29,,,,,"",
TEXTONLY,"X[a2]",6,29,,,,,"",
!
Post Reply