Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "Writing short functions in WEAP"
Log in to post new messages or reply to existing messages.
 
Author Message
Dr. Younes Fakir

Subject: Writing short functions in WEAP   
Posted: 4/17/2024 Viewed: 1643 times
When expression a function, we may refer several times to files with RreadFromFile. Therefore, the function could be long and complicated to read. Is there any hint for simplifying the writing of functions in WEAP.
Mr. Doug Chalmers

Subject: Re: Writing short functions in WEAP   
Posted: 4/17/2024 Viewed: 1634 times
Younes,

I understand- I often face this as well. Some options to store ReadFromFile values as other variables to shorten your expressions:

1. You could enter your ReadFromFile expressions as Key\ or Other\ in the data tree.

2. To shorten them the most, you could create a custom variable in the data tree by going to your model object, right clicking on the name of the variables at the top --> "Create". Then, store your ReadFromFile values into custom variables within the same WEAP object and reference them in your new expression. The new expression will then only have the name of the custom variable and its unit, shortening your expression.

Cheers,
Doug
Topic "Writing short functions in WEAP"