zone97 Posted February 8, 2017 Share Posted February 8, 2017 (edited) Is it possible to create a string from a string? Like.. $search = "name" blah blah.. $[$search] = "John doe" ; sure this isn't right but its what I mean. which should equal $name = "john doe" I want to read a file, get a list of headings, then create strings from those headings using the found heading text as string name? Edited February 8, 2017 by zone97 Spoiler WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ] Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2017 Share Posted February 8, 2017 Sounds like you need a scripting dictionary. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
iamtheky Posted February 8, 2017 Share Posted February 8, 2017 if you have found what string you want to use for the variable and found the string you want to ASSIGN, you should use ASSIGN. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
mikell Posted February 8, 2017 Share Posted February 8, 2017 Hmm this works indeed $search = "name" Assign($search, "John doe") Msgbox(0,"", $name) but I wouldn't recommend this way ... Link to comment Share on other sites More sharing options...
iamtheky Posted February 9, 2017 Share Posted February 9, 2017 i wouldn't either, but only because you are missing an isdeclared line before the assign. other than that why not? it seems perfectly logical. and you get the bonus of a separate error for the search and flexibility on the behavior with duplicates. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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