Jump to content
Sign in to follow this  
geotau3

how to change string to variable

Recommended Posts

geotau3

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
JLogan3o13

@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!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
geotau3

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
iamtheky

Assign?


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

Share this post


Link to post
Share on other sites
kylomas

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
geotau3

Just shurt cut 

 

Share this post


Link to post
Share on other sites
geotau3

no too much code will be slow 

any way this make faster 

Share this post


Link to post
Share on other sites
kylomas

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  

×