Seperation into variables

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Bilde
Junior Coder
Posts: 31
Joined: Fri Nov 15, 2002 3:19 pm
Location: Denmark

Seperation into variables

Post by Bilde » Tue Jan 03, 2006 2:39 pm

Hi I want to read ip and port form a txt file and make them into variables:

I though of ReadLn, to get the line "ip.goes.here:port" but how do i seperate it into 2 variable that I can use for my macro?

thx in advance!

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 Jan 03, 2006 3:09 pm

Use the Separate command:

Separate>line,:,vars

The colon is the delimiter in this case. You will end up with vars_1 with the IP address and vars_2 with the port number.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Bilde
Junior Coder
Posts: 31
Joined: Fri Nov 15, 2002 3:19 pm
Location: Denmark

Post by Bilde » Tue Jan 03, 2006 3:10 pm

ah, so easy :D
thx!

Bilde
Junior Coder
Posts: 31
Joined: Fri Nov 15, 2002 3:19 pm
Location: Denmark

Post by Bilde » Tue Jan 03, 2006 3:24 pm

Hm it's not working when I run it in the edit window, and it returns vars_1,
But it's working fine if it's not open, and return the ip. How can this be?

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 Jan 03, 2006 3:37 pm

Probably because you are not stepping through all the code? Maybe you're missing some important code by running the debugger from a line later in the process. If you want to run the whole thing in the editor make sure the first line is selected because the debugger runs or steps from the selected line (the line where the cursor is).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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