Sign in to follow this  
Followers 0
ashley123

Reading a Text line with embedded Variable?

3 posts in this topic

#1 ·  Posted (edited)

Hello, I've tried this, but it doesn't work, it will either show everything as text that I read or nothing...

Is it possible to use the line you read as a variable?

global $VARIABLENAME = "john"

$TEXT = FileReadLine(@WorkingDir&"\TEST\testme.txt",1)

$NEW = $TEXT

MsgBox (0, "", $NEW , "0" , "")

AND then the line in the text file to read is this:

$VARIABLENAME

But I want to be able to include normal text in the lines also if possible like:

"Your package will arrive shortly," &$VARIABLENAME

Edited by ashley123

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

global $NAME1 = "Ashley123"
$TEXT = FileReadLine(@ScriptDir&"\txt.txt",1); contains: "Your Answer is here, " & $Name1
$NEW = Execute($TEXT)
MsgBox (0, "", $TEXT & " ==> " & $NEW)

Edit: code tags

Edited by Spiff59

Share this post


Link to post
Share on other sites

Ah thanks for the help. That works, I didn't know of the Execute function : )

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