Sign in to follow this  
Followers 0
geotau3

how to change string to variable

8 posts in this topic

how to change string to variable 

if use it function by entering string and use to be variable

if you enter abc it will be $abc and use it 

Share this post


Link to post
Share on other sites



@geotau3 I am going to guess you're wanting to use a variable input by an end user? Rather than trying to take the string and make it into a variable (which means you won't know what that variable name is throughout your code until the user enters the string), why not just set the variable name to something you know ahead of time, regardless of the string? Something like this? It makes for much easier to manage code:

#include <MsgBoxConstants.au3>

Local $sInput = InputBox("Whatever you type in will become the value of $sInput", "", "", Default, 400)
MsgBox($MB_OK, "The value of $sInput", $sInput)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

good try but let say i have Function witch have but i do want create case for each variable i had so Fun GET($entrydata, $nameofvriablewilluse)

 

Share this post


Link to post
Share on other sites

Assign?


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

geotau3,

What do you think your select/switch stmt would look like?

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Just shurt cut 

 

Share this post


Link to post
Share on other sites

no too much code will be slow 

any way this make faster 

Share this post


Link to post
Share on other sites

Yes


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0