Conditional, global search and replace?

Got a question or comment about PowerChurch that doesn't belong anywhere else? Why not post it here!?

Moderators: Moderators, Tech Support

Zorak
Tech Support
Tech Support
Posts: 3006
Joined: Thu May 13, 2004 9:59 am
Location: PowerChurch Software
Contact:

Re: Conditional, global search and replace?

Post by Zorak »

That error happens when the path you are telling it to COPY TO doesn't exist.

pbumc
Posts: 77
Joined: Sat Mar 10, 2007 4:28 pm
Location: San Diego, CA

Re: Conditional, global search and replace?

Post by pbumc »

Ah, of course. On the computer where I got the error, the name of the user's folder includes the domain name. I just tried

Code: Select all

COPY TO "%USERPROFILE%\DESKTOP\TEMP.XLS" TYPE XL5
but that gives the same error--maybe FoxPro won't expand environment variables?

Hard-coding the full path works.
Mark Berry

Zorak
Tech Support
Tech Support
Posts: 3006
Joined: Thu May 13, 2004 9:59 am
Location: PowerChurch Software
Contact:

Re: Conditional, global search and replace?

Post by Zorak »

It does not. I just tried CD %USERPROFILE% with and without quotes and got invalid path or filename.

pbumc
Posts: 77
Joined: Sat Mar 10, 2007 4:28 pm
Location: San Diego, CA

Re: Conditional, global search and replace?

Post by pbumc »

I do like a challenge :). Looks like GETENV will do it.

Code: Select all

COPY TO GETENV("USERPROFILE") + "\DESKTOP\TEMP.XLS" TYPE XL5
Mark Berry

pbumc
Posts: 77
Joined: Sat Mar 10, 2007 4:28 pm
Location: San Diego, CA

Re: Conditional, global search and replace?

Post by pbumc »

In case anyone is following this thread: I realized that the SELECTs were including profiles whose attendance was expected (active in the 1002 activity) whether they were Present or not. I updated the three scripts to add "and atdata.status = 'P'", which confirms that the person was Present at the activity.

See this post above for the updated scripts: viewtopic.php?p=45901#p45901.
Mark Berry

Post Reply