geotau3 Posted December 7, 2016 Share 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 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 7, 2016 Moderators Share 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! Link to comment Share on other sites More sharing options...
geotau3 Posted December 7, 2016 Author Share 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) Link to comment Share on other sites More sharing options...
iamtheky Posted December 7, 2016 Share Posted December 7, 2016 Assign? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
kylomas Posted December 7, 2016 Share 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 Link to comment Share on other sites More sharing options...
geotau3 Posted December 8, 2016 Author Share Posted December 8, 2016 Just shurt cut Link to comment Share on other sites More sharing options...
geotau3 Posted December 8, 2016 Author Share Posted December 8, 2016 no too much code will be slow any way this make faster Link to comment Share on other sites More sharing options...
kylomas Posted December 8, 2016 Share 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 Link to comment Share on other sites More sharing options...
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