Code in the Next Method

The place for peer-to-peer support for Visual ProMatrix versions older than VPME 9.1.

Code in the Next Method

Postby jporrata » Mon May 25, 2015 12:09 pm

Hi,

How can I put some code in the next, prior, first and last method of a form to check a condition and if the condition is not met, cancel the movement so it stays on the same record?

I have tried but I get an error when the condition is met.

Example:

if somecondition
return .f. <- this causes an error
else
return dodefault()
endif

Thanks
jporrata
 
Posts: 85
Joined: Mon Aug 16, 2010 3:55 pm

Re: Code in the Next Method

Postby Bob » Tue May 26, 2015 4:23 am

If you look at the parent next method, the expected return values are based on #define words found in the VPM home folder in main.h, eg FILE_CANCEL. These are numeric hence the error. Try the FILE_CANCEL return value.
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: Code in the Next Method

Postby jporrata » Wed May 27, 2015 8:36 am

Thanks Bob. I was able to use those values
jporrata
 
Posts: 85
Joined: Mon Aug 16, 2010 3:55 pm


Return to VPM - older versions

Who is online

Users browsing this forum: No registered users and 1 guest

cron