Read Variable from Text File?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Read Variable from Text File?

Post by Dexter1 » Tue Oct 24, 2006 3:18 pm

Is it possible for me to grab a variable value from a text file? I have macros that send emails which I have compiled into .exes. The problem is that I have to recompile the macros every time somebody asks to be added or removed from the distribution. If I could just get these values from a text file I wouldn't have to recompile.

Thanks in Advance,
Josh
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 24, 2006 3:24 pm

Use an INI file. Use the ReadIniFile command.

Or for a simple text file use ReadLn.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Oct 24, 2006 3:28 pm

You could set up an INI file then use the ReadIniFile> function. the Ini file might look something like:
You would loop through looking at the recips until you run into the one labeled stop.

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Post by snapper1969 » Sun Aug 24, 2008 2:20 pm

JRL wrote:You could set up an INI file then use the ReadIniFile> function. the Ini file might look something like:
You would loop through looking at the recips until you run into the one labeled stop.
JRL...How would I loop through the file with the recip's being 1 - 4?.

Thx,

John

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Aug 24, 2008 2:41 pm

Code: Select all

Let>n=1
Label>starthere
ReadIniFile>c:\temp\mail.ini,recipients,recip%n%,recip
If>recip=stop,finish
MDL>recip
Let>n=n+1
GoTo>starthere
Label>finish
MDL>It's over!

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Post by snapper1969 » Sun Aug 24, 2008 9:40 pm

Thx, this was very helpful.

John

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts