Macro cuts off char
Moderators: Dorian (MJT support), JRL
Macro cuts off char
Hi all,
I have a macro that is misbehaving and I hope some of you can provide some insight.
Overall:
I have this macro that copies a text string and split the text string into multiple variables.
Some of the content is:
%BWID% - 6 digit ID (example 123456)
%BWM2% - Size in m2
%BWBUILD% - Build year
First issue:
When I try to do:
Send>http://mywebsite.com/property/%BWID%/details
The result is: http://mywebsite.com/property/%BWID%/details
Where its supposed to be: http://mywebsite.com/property/123456/details
If I do:
Send>http://mywebsite.com/property/
Wait>0.5
Send>%BWID%
Wait>0.5
Send>/details
All works as its supposed to. So why am I unable to do the full string?
Second issue.
When I try to use
%BWM2% - Size in m2 (Example 130)
%BWBUILD% - Build year (Example 1988)
And I test the values after they are captured all is good.
I try and test the variables with "MessageModal" on serveral places and it contains the right data.
However, when I reach the end of my macro and I want to populate the data to a webform like:
Send>%BWM2%
Send>%BWBUILD%
I has cut of some of the data so:
%BWM2% becomes 13
%BWBUILD% becomes 198
But when testing with MessageModal just prior to placing the data in the form the full data is available.
Any help here would be much appreciated.
I have a macro that is misbehaving and I hope some of you can provide some insight.
Overall:
I have this macro that copies a text string and split the text string into multiple variables.
Some of the content is:
%BWID% - 6 digit ID (example 123456)
%BWM2% - Size in m2
%BWBUILD% - Build year
First issue:
When I try to do:
Send>http://mywebsite.com/property/%BWID%/details
The result is: http://mywebsite.com/property/%BWID%/details
Where its supposed to be: http://mywebsite.com/property/123456/details
If I do:
Send>http://mywebsite.com/property/
Wait>0.5
Send>%BWID%
Wait>0.5
Send>/details
All works as its supposed to. So why am I unable to do the full string?
Second issue.
When I try to use
%BWM2% - Size in m2 (Example 130)
%BWBUILD% - Build year (Example 1988)
And I test the values after they are captured all is good.
I try and test the variables with "MessageModal" on serveral places and it contains the right data.
However, when I reach the end of my macro and I want to populate the data to a webform like:
Send>%BWM2%
Send>%BWBUILD%
I has cut of some of the data so:
%BWM2% becomes 13
%BWBUILD% becomes 198
But when testing with MessageModal just prior to placing the data in the form the full data is available.
Any help here would be much appreciated.
Re: Macro cuts off char
Hi! Looks strange... You could try to send the text to Notepad to check if that gives the same result. Also make sure the variables are defined correctly. For example, the first (incorrect) version below would give the (first) problem you encounter:
Let>%BWID%=123456
Let>BWID=123456
Let>%BWID%=123456
Let>BWID=123456
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Macro cuts off char
I think hagchr is right on the money regarding the first issue. If you try it in Notepad you'll see it behaves exactly as he describes.
With regards to the second issue - If they look correct just prior to posting, but post incorrectly, I wonder if there are some control characters in there somewhere? What happens if you use Trim?
Just out of interest, I'd try running it step by step and copying the variable and value from the watch list (right-click on the watchlist line, "copy Line") then pasting somewhere to see what it looks like.
With regards to the second issue - If they look correct just prior to posting, but post incorrectly, I wonder if there are some control characters in there somewhere? What happens if you use Trim?
Code: Select all
Trim>%BWM2%
Trim>%BWBUILD%
Yes, we have a Custom Scripting Service. Message me or go here
Re: Macro cuts off char
All, thanks for your feedback.
So to try and troubleshoot the issue I did:
And the expected result would be:
My text followed by 123456
But the result is:
My text followed by %Test2%
So to try and troubleshoot the issue I did:
Code: Select all
Wait>1
Let>%Test%=123456
Wait>0.5
Let>%Test2%=My text followed by %Test%
Wait>0.5
MessageModal>%Test2%
My text followed by 123456
But the result is:
My text followed by %Test2%
Re: Macro cuts off char
But this is working:
Wait>1
Let>Test=123456
Wait>0.5
Let>Test2=My text followed by %Test%
Wait>0.5
MessageModal>Test2
So I might overdue the % that when I'm using variables.
Wait>1
Let>Test=123456
Wait>0.5
Let>Test2=My text followed by %Test%
Wait>0.5
MessageModal>Test2
So I might overdue the % that when I'm using variables.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Macro cuts off char
The when to use the percent symbol article may help you.
Mis-use can cause havoc! We've all done it at some point, and it can cause a lot of head scratching when looking for it. The following snippet shows how we can turn 1 into 3 by mis-use of the %
Mis-use can cause havoc! We've all done it at some point, and it can cause a lot of head scratching when looking for it. The following snippet shows how we can turn 1 into 3 by mis-use of the %
Code: Select all
//Let's start with this...
let>a=1
//Then later in the script we erroneousely use the %
let>%a%=3
//We've actually turned 1 into 3.
mdl>1
mdl>we turned 1 into %1%
Yes, we have a Custom Scripting Service. Message me or go here
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Macro cuts off char
I couldn't resist
Code: Select all
//Let's start with this...
let>pet=dog
//Then later in the script we erroneousely use the %
let>%pet%=cat
//We've actually turned dog into cat.
mdl>dog
mdl>we turned dog into %dog%
Yes, we have a Custom Scripting Service. Message me or go here
Re: Macro cuts off char
All,
Thank you so much for all your help. I removed the % in all non needed places and now everything is running smoothly.
Thank you so much for all your help. I removed the % in all non needed places and now everything is running smoothly.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Macro cuts off char
You're very welcome. That's great to hear!
Yes, we have a Custom Scripting Service. Message me or go here