Desperate! Please help..Decimals and zeros the same??

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
funknugget
Newbie
Posts: 5
Joined: Fri Oct 17, 2003 11:27 am

Desperate! Please help..Decimals and zeros the same??

Post by funknugget » Fri Oct 17, 2003 11:34 am

Ok, apparently Macro scheduler considers a period or decimal "." to be the same as a zero.."0". I"m trying to write a macro to filter out zeros and periods separatelym but it reads them the same. Here's a small example I made just to see if I was going crazy. Either one has the same result.

Let>a=0
Let>b=.
If>a=.,Here,There
Label>Here
Send>See???
Label>There

or example 2.....

Let>a=0
Let>b=.
If>b=0,Here,There
Label>Here
Send>See???
Label>There

Is there something obvious here that I'm not seeing??

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 17, 2003 1:12 pm

Try:

If>"%a%"=".",Here,There

or

If>"%b%"="0",Here,There
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 17, 2003 2:16 pm

Hmmm, curious...

1. I was able to duplicate funknugget results. Really surprised!

2. I tried Let>%a%=.,Here,There and got the same failing results

3. I then saw support suggestion to try Let>"%a%"=".",Here,There and got the correct result.

Are you suggesting that "quotes" are needed to force number characters to be interpreted as strings?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

funknugget
Newbie
Posts: 5
Joined: Fri Oct 17, 2003 11:27 am

Thanks!

Post by funknugget » Fri Oct 17, 2003 8:59 pm

Hi Bob and support team. Thanks for your help. I haven't tried it yet, but I'm assuming it will work. I imagine I'll figure this out through trial, but I might as well ask. Do I need to use VAREXPLICIT before doing what's described above?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 17, 2003 9:05 pm

Hi,

No, you do not need to use VAREXPLICIT for this.
MJT Net Support
[email protected]

funknugget
Newbie
Posts: 5
Joined: Fri Oct 17, 2003 11:27 am

Ok, this is frustrating

Post by funknugget » Fri Oct 17, 2003 9:29 pm

Ok, I guess I'm still not getting this. Can you tell me exactly how this macro should look to make it work with the quotes and percentage symbols because I can't get it to? This is closer to what I'm actually using in my larger macro to remove zeros and periods.

GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>char=.,Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard

This macro DOES work for removing periods, but it will also remove any zeros in the string and I need it to leave the zeros, while still removing the periods.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 17, 2003 10:26 pm

Hi,

Change the macro to:

GetClipboard>Clipboard
Let>MyVal=Clipboard
Let>k=0
Length>MyVal,lv
Let>NewVal=
Label>Trime
Let>k=k+1
if>k>lv,Done
MidStr>MyVal,k,1,char
If>"%char%"=".",Trime
ConCat>NewVal,char
Goto>Trime
Label>Done
Let>Clipboard=NewVal
Send>Clipboard
MJT Net Support
[email protected]

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