geotau3 Posted December 7, 2016 Posted December 7, 2016 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
Moderators JLogan3o13 Posted December 7, 2016 Moderators Posted December 7, 2016 @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) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
geotau3 Posted December 7, 2016 Author Posted December 7, 2016 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)
iamtheky Posted December 7, 2016 Posted December 7, 2016 Assign? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
kylomas Posted December 7, 2016 Posted December 7, 2016 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
geotau3 Posted December 8, 2016 Author Posted December 8, 2016 no too much code will be slow any way this make faster
kylomas Posted December 8, 2016 Posted December 8, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now