Sign in to follow this  
Followers 0
zone97

String name from string?

5 posts in this topic

#1 ·  Posted (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 by zone97

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Share this post


Link to post
Share on other sites



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.


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

Share this post


Link to post
Share on other sites

Hmm this works indeed

$search = "name"
Assign($search, "John doe")
Msgbox(0,"", $name)

but I wouldn't recommend this way ... :mellow:

Share this post


Link to post
Share on other sites

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. 


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

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