Groups > WordPerfect Office > Quattro Pro older versions > Re: QP9 Macro Newbie Question




QP9 Macro Newbie Question

QP9 Macro Newbie Question
Wed, 25 Jul 2007 18:42:45 +010
In cell A1 I have the full pathname of a directory on my PC.
In cell C1 I have the file extension ".csv"

This is a fragment of a macro:

do_proc	{DEFINE B1}
	{}
	{ParseExpert.InputType File}
	{ParseExpert.InputFile A1&B1&C1}
	{ParseExpert.OutputBlock........

The argument passed into B1 contains the name of a file such that the 
concatenation of A1 and B1 and C1 gives its complete name.

The macro fragment doesn't work, but I can make it work by making the 
macro self-modifying so that the {ParseExpert.InputFile cell contains 
the full hierarchical name of the file before the cell is executed
ie {Let B100,"{ParseExpert.InputFile
"&A1&B1&C1&"}"}

Is there a way of making the macro concatenate A1 and B1 and C1 at run 
time? If not, is my self-modifying macro the best circumvention?

Thanks for your help,

NigelH

Post Reply
Re: QP9 Macro Newbie Question
Wed, 25 Jul 2007 19:01:20 +010
NigelH:
> I can make it work by making the 
> macro self-modifying so that the {ParseExpert.InputFile cell contains 
> the full hierarchical name of the file before the cell is executed
> ie {Let B100,"{ParseExpert.InputFile
"&A1&B1&C1&"}"}
> 
> Is there a way of making the macro concatenate A1 and B1 and C1 at run 
> time? If not, is my self-modifying macro the best circumvention?

I assume that B100 is the location of the {ParseExpert.InputFile command.

Then it can be made into an "automatic" command that, as it were, 
modifies itself:

+"{ParseExpert.InputFile
"""&A1&B1&C1""&"}"

I rather think that double quotes should surround the drive:\path\name.
Then this will do better:
+"{ParseExpert.InputFile
"""&A1&B1&C1&"""}"
-- 
Good wishes!
Roy Lewis
C_Tech volunteer
(UK)

Post Reply
Re: QP9 Macro Newbie Question
Wed, 25 Jul 2007 19:04:41 +010

> +"{ParseExpert.InputFile
"""&A1&B1&C1""&"}"

Too hasty. That first example should be:

+"{ParseExpert.InputFile "&A1&B1&C1&"}"

as in your {Let... command.
-- 
Good wishes!
Roy Lewis
C_Tech volunteer
(UK)

Post Reply
Re: QP9 Macro Newbie Question
Thu, 26 Jul 2007 15:18:32 +010
lemoto wrote:

> 
>>+"{ParseExpert.InputFile
"""&A1&B1&C1""&"}"
> 
> 
> Too hasty. That first example should be:
> 
> +"{ParseExpert.InputFile
"&A1&B1&C1&"}"
> 
> as in your {Let... command.

Thanks, it looks so obvious now you've shown me how to do it.

Apologies for the {Let... command - I knew I had got something working 
previously but I couldn't remember the exact format. It does seem to 
need the double quotes round the filename. Below is what actually worked 
for me, copied and pasted apart from the target cell address:
{LET B100,"{ParseExpert.InputFile
"&""""&A1&B1&C1&"""&
quot;&"}"}

Many thanks,

NigelH

Post Reply
Re: QP9 Macro Newbie Question
Thu, 26 Jul 2007 18:43:30 +010
NigelH:
> Thanks, it looks so obvious now you've shown me how to do it.
>
Yes. It took me months. I did not think of the term "automatic" 
so I found nothing in Help, and thrashed around until Jim Latham 
specified the initial +.
Of course, that was obvious once he pointed it out.-)}
-- 
Good wishes!
Roy Lewis
C_Tech volunteer
(UK)

Post Reply
about | contact