New Entry (OpenInsight Specific)
At 27 APR 1998 01:53:11PM Richard Richter wrote:
I am trying to determine in a form if an entry is a new record or previously entered. I tried using the in the windows title bar but I've found that to be unreliable. Any suggestions would be greatly appreciated.
Richard Richter
At 27 APR 1998 05:28PM Blaise(Revelation) wrote:
Richard,
There are a couple of ways to do so.
1) If you programatically try to read the record using the 'READ' command, you can check the variable that is going to hold your data.
2) After the OI code is executed, the READ event is triggered, look at the @RECORD variable. If it's empty the record is new.
Good Luck…
Blaise
At 27 APR 1998 06:16PM Dave Pociu wrote:
Blaise,
Could you please check if there is also some COMMON variable that gets set at READ time? I seem to remember something like that but I'm not sure …
Thanks
Dave
At 27 APR 1998 10:59PM Cameron Revelation wrote:
Richard,
When a key is entered and the record does not exist, the SYSMSG event is sent with the following message code (from PS_EQUATES):
EQU SYSMSG_NEWROWINFO$ TO 12 /* New row informational - null msg */
So your code in READ could look like:
declare subroutine Set_Property
$insert Logical
Set_Property(@window, "@NEW", FALSE$)
return 1
And your code in SYSMSG could look like:
declare subroutine Set_Property
$insert Logical
$insert PS_Equates
if MsgCode=SYSMSG_NEWROWINFO$ then
Set_Property(@window, "@NEW", TRUE$)end
return 1
From anywhere in your form, you can determine if the key is new by checking:
if Get_Property(@window, "@NEW") then …
Cameron Purdy
Revelation Software
At 28 APR 1998 09:03AM Dave Pociu wrote:
Cameron just answered that. Thanks
At 29 APR 1998 03:54PM Aaron Kaplan wrote:
Blaise,
Hate to be critical, but if the @RECORD is empty, it could be an empty record, not necessarily one that doesn't exist.
apk@sprezzatura.com