Here you can discuss any topic concerning Far macro commands.
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 1:07 am
Hi
I need a while loop to loop as long as two strings are diffrent like this:
$While ( %string1 != %string2) do somthing $End
But it don't work for me, anyway to do this?
t-rex
Admin
Posts: 417 Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:
Post
by t-rex » Wed Apr 26, 2006 1:21 am
jonib
I'm not an expert on macros but as far as I know it should work. Could you provide the full macro sequence?
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 2:39 am
This example works shows a message "Strings match":
Macro:Post $If ("String"=="String") msgbox("Test","Strings match",0) $Else msgbox("Test","Strings don't match",0) $End
This should show a message "Strings don't match" but nothing happens:
Macro:Post $If ("String"!="String") msgbox("Test","Strings match",0) $Else msgbox("Test","Strings don't match",0) $End
Only diffrens "==" and "!=".
HaRT
Posts: 100 Joined: Thu Mar 09, 2006 6:33 pm
Location: St. Petersburg, Russia
Post
by HaRT » Wed Apr 26, 2006 8:04 am
Works perfectly.
What version of FAR (and of the FarCmds plugin) do you use?
t-rex
Admin
Posts: 417 Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:
Post
by t-rex » Wed Apr 26, 2006 10:04 am
jonib
Works fine as HaRT said. If you tried to add this to the registry did you remember to escape each " character with \ - like this \" ?
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 2:09 pm
t-rex wrote: jonib
Works fine as HaRT said. If you tried to add this to the registry did you remember to escape each " character with \ - like this " ?
I should have specified that I run the macro from "File associations".
Now I tested it from registry and commandline and it works but not from "File associations"
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 2:13 pm
HaRT wrote: Works perfectly.
What version of FAR (and of the FarCmds plugin) do you use?
I use the "mantis97.1.rar" version that t-rex posted before and FarCmds from the last FAR relese.
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 2:17 pm
I tested FAR ver 1.70 build 2087 on another PC and it's the same.
t-rex
Admin
Posts: 417 Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:
Post
by t-rex » Wed Apr 26, 2006 3:08 pm
jonib
What exactly do you write in the "File associations"?
Remember that !.! expands to something with backslashes and makes the macro inoperable.
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 3:21 pm
t-rex wrote: jonib
What exactly do you write in the "File associations"?
Remember that !.! expands to something with backslashes and makes the macro inoperable.
Exactly like I wrote:
Macro:Post $If ("String"!="String") msgbox("Test","Strings match",0) $Else msgbox("Test","Strings don't match",0) $End
t-rex
Admin
Posts: 417 Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:
Post
by t-rex » Wed Apr 26, 2006 3:26 pm
jonib
Well, ! is "Long file name without extension" in "File associations".
Write like this:
Macro:Post $If ("String"!! ="String") msgbox("Test","Strings match",0) $Else msgbox("Test","Strings don't match",0) $End
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 3:37 pm
jonib
Posts: 70 Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden
Post
by jonib » Wed Apr 26, 2006 4:36 pm
If my last message was not clear it works now when I use "!! ", I did not think of the special symbols in "File associations", but i'm still learning the more advanced macro stuff and forgot other stuff.