Alex wrote:
> The If() expression is documented on the Expressions page 
> of PowerPro help.
[followed by a description of its usage]

I should point out to DJB that what Alex wrote about 
the If Expression was a "by the way" to Hakki,
not (I hope) a recommended solution to your problem.

Yes DJB's attempted solution:
> If
> (validpath("F:\*"), (Run F: Drive sync))
does look like more like the If Expression rather than
the If Statement (though it still has the wrong syntax,
even for how to use the If expression).
So I assume DJB read about the wrong function in Help;
he needs an If Statement (as described by Hakki)
not an If Expression (as described by Alex).

Those two "If"s have very different purposes and syntax.

The If Statement starts a line of its own. It is used to 
conditionally run either a one-line command or a bunch of 
lines in a script.
Thus:
- If(conditional expression)
- execute this one line if condition is true
- this line is always executed
Or thus:
- If(conditional expression) do
- execute this line if condition is true
- and these following lines because he used "do" after the "if"
- endif
- this line is always executed

By contrast:
The If Expression does not start a line of its own.
It always appears as a parameter (aka argument) 
to conditionally choose the value for that parameter.
Thus:
- string1 = "week"
- string2 = "day"
- win.debug If(dayofweek != 0,string1) ++ string2
will send "day" on a Sunday
will send "weekday" on a Monday to Saturday
as the argument for "win.debug".

----------------------------------------------------------

Having shown that you need an If Statement,
not the If expression,
I should correct parts of Hakki's suggested syntax.

It seems Hakki missed some of DJB's words:
DJB> Trying to set a command to check if my USB drive is plugged 
DJB> in at start up and if so run a command list.

Hakki wrote:
HA> 4-(Run F: Drive sync) is wrong in every possible way:

Actually "Run F: Drive sync" is correct as the command to
run a command list called "F: Drive sync"

So DJB needs just two statements:
- if (validpath("f:\*"))
- Run F: Drive sync

Or you could try:
- if (mounted("f"))
- Run F: Drive sync

If this is an Item in a command list
then the second statement: Run F: Drive sync
should be typed into the More Commands box.

For the first statement, it would work to either:
place the entire statement: if(validpath("f:\*")
[N.B. without any space characters] in the first box
or split it into the boxes thus:
Command:: *Script
Action:: If
Expression:: (validpath("f:\*"))

Alan Martin






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to