Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I call a function from a menu, pass a argument then run?
#1
Hi Gintaras,

I think I'm going nuts...

This line used in a menu works to open Explorer with only the C:\ drive listed.

c: :run "Explorer" "/e, /root, C:\"

So I wanted to do a menu with the paths I use most and figured using a function to build and execute the run statement would be most efficient. I realize it's probably NOT the best way now that I've looked at it but I'd still like to know what I'm doing wrong.

I figured out how to call the function from a menu and pass the path as a variable but I can not for the life of me build a run statement that works.

Here's what I've got.

The menu:

Code:
Copy      Help
c: :str drive="c:\''"; ExploreOnly2(&drive)

Is there any way to send the path itself without having to plug it into a variable? Couldn't figure that one out either. Kept getting syntax errors if I used variations of:

Code:
Copy      Help
c: :ExploreOnly2("C:\")

and my function ExploreOnly2

Code:
Copy      Help
/
function str&drive
str s="''explorer'' "
str so="''/e, /root, "
run str'z.from(s so drive)

I've tried every combination of with quotes, without quotes, w/spaces, w/o spaces...It's killing me. Even if I hard code the path within the function into str'so I can seem to concatenate a run statement that works.

Any Ideas?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)