Tim,

Adding the code you provided worked. Thank you very much.

I noticed that the {STATE} value is often higher than 1024 (because of the other things going on with DP, but the code still works. How is that so.

Also what is the role of the "&" in {STATE}&1024?

Thank you again.

Victor

Tim Rude wrote:
Victor,

Have the shell macro go ahead and try to go through the link using the
down arrow. If there isn't an existing record, DP will pop up the
following prompt:

No records are found in this subset.  If you want to add records,
press Create Record in Linked Panel (F5).  Otherwise, you will
remain in this panel.

It will also sit there waiting for the user to press a key to dismiss
the prompt.

Your macro can check to see if the prompt is displayed by looking at the
{STATE} value. While the prompt is displayed and DP is waiting for a
user response, {STATE}&1024 will not be zero (i.e True).

So your shell macro could do something like this:

{Down}
{WAIT}2~
{IF}{STATE}&1024~
   {;}No existing records, dismiss dialog and press F5 to create one...~
   {Enter}
   {F5}
{ELSE}
   {;}Found at least one existing record, do something with it...~
{END IF}

The 2/10 second pause after the {Down} keystroke may not be needed. I
was just wanting to make sure DP had time to respond to the keystroke
before checking if the user prompt was displayed. Experiment with it to
see whether it's needed or not.

Tim Rude

----- Original Message ----- From: "Victor Warner" <[EMAIL PROTECTED]>
To: "Dataperfect Users Discussion Group" <[email protected]>
Sent: Saturday, June 28, 2008 6:33 AM
Subject: [Dataperf] How to determine whether linked database has
recordusing shell macro


I would like to create a shell macro which

1. Goes to field in a DP database which is a link; and
2. Test whether the linked database has a record
3. If there is a record, to go into (eg down arrow), or
4. If there is not create a record (eg F5).


I can create all of the shell macro except for the testing in 2.

Is this possible? And how can it be done? Help with this would be
greatly appreciated.

Victor Warner
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

Reply via email to