First time here? Check out the FAQ!
1

${WING:FILENAME} example needed
 

I have tried so many ways to use ${WING:FILENAME} in my script, that I am out of ideas. In my script, I want to use the filename of the script as a variable. So simply put, I want something like this:

fileName = ${WING:FILENAME}

After reading https://wingware.com/doc/proj/variabl... I tried just about every combination, including os.environ.get, but I keep getting a syntax error on ${WING:FILENAME}. I am positive I am just making a stupid mistake in my thought process somewhere, but I just need to be able to use this variable. So I need help :-/

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
jrobijns's avatar
78
jrobijns
asked 4 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 4 years ago

Comments

see more comments

1 Answer

0

${WING:FILENAME} can only be used within Wing to configure your project and is not automatically set in the environment of processes that Wing launches. You can set an environment variable to its value yourself by adding a MYFILENAME=${WING:FILENAME} to the environment.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 4 years ago
link

Comments

That was exactly what I needed to know. Thanks!

jrobijns's avatar jrobijns (4 years ago)
see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)