Why does curobj change? (Vsn 2.0) 
Author Message
 Why does curobj change? (Vsn 2.0)
When a GET field VALID changes the value of  a field without
creating an error, _curobj appears to get reset to the first available
field.  Why does this happen?  How it can it be overcome?  Setting _curobj
inside
the VALID appears to have no affect.  So far my only solution has been to
change
_curobj inside of the WHEN clause of the first field, but this seems
inelegant.  Any ideas?


Mon, 23 Dec 1996 12:26:04 GMT
 Why does curobj change? (Vsn 2.0)

: When a GET field VALID changes the value of  a field without
: creating an error, _curobj appears to get reset to the first available
: field.  Why does this happen?  How it can it be overcome?  Setting _curobj
: inside
: the VALID appears to have no affect.  So far my only solution has been to
: change
: _curobj inside of the WHEN clause of the first field, but this seems
: inelegant.  Any ideas?

What value is the GET field's VALID returning?  If it returns a number,
the current field will be moved by that number of fields, which will
change _curobj.

Does the VALID contain a SHOW GETS?  I think SHOW GETS invokes one of the
screen level snippets, which may also reset the current field.



Mon, 23 Dec 1996 20:02:42 GMT
 Why does curobj change? (Vsn 2.0)
I've tried the return clause with a string value and with no value at all.
 I've tried the clause with a SHOW GET clause, but not with a SHOW GETS
clause.


Tue, 24 Dec 1996 11:40:01 GMT
 Why does curobj change? (Vsn 2.0)
: When a GET field VALID changes the value of  a field without
: creating an error, _curobj appears to get reset to the first available
: field.  Why does this happen?  How it can it be overcome?  Setting _curobj
: inside
: the VALID appears to have no affect.  So far my only solution has been to
: change
: _curobj inside of the WHEN clause of the first field, but this seems
: inelegant.  Any ideas?

This was a good question and it started me thinking about what goes on
"under the hood".  Typically when I change _curobj in a valid of a routine I
make sure I return either .t. or .f. or 1 or 0.  .f. and 0 cause a return
to the field that your in. .t. or 1 moves to the next available field. or in
a read cycle to if the active get is the last field of the screen, the first
field.  When I use _curobj in a field I either explicitly(sp?) set curobj to
a field number or I do a _curobj=objnum(fieldname).  then return a .t. at
the end of the valid snippet or function.  This works real well.

Well I just did a 'speriment. I created a screen with 5 fields. field1 thru
field5 on a screen with a read cycle.   I put a valid onthe first field like
this:
        field1 = retval
        return retval

so when field1 is exited, the value which I typed into field1 becomes the
return value.  now is the exciting part. when I left field1 and had a high
number in it next field was the mod(retval, numberofofields).  What I
believe is happening is that _curobj is the number which controls the next
get object.  and curobj changes by the return value in the valid field or an
implicit 1 when there is no valid or return value. a return value of 0
leaves the cursor on the same field. a return value of .f. (logical 0)
rerurns to the same field. a terurn value of .t. (logical 1) or 1, adds 1 to
thevalue of _curobj.  a return value > 1  adds that number to the value of
_curobj and causes a relative move of retval fields.

Thanks for the idea, it is not documented in the help screen under _curobj.
I'm going to look further.

this helps me explain the behabvior of some multiscreen wierdness when the
last object of the screen returns a .f. in the when and and  you page up
are on the next screen. then page up. you are bounced onto the second
screen. howeever when you up arrow into the previous screen you are sent to
the next to last field.  This is part of an interesting exploration.  the
best previous answer was, don't do that, disable the last field no .f in
when.  However doing this adversly affects the screen colors.  
Steven Finkelman
DATA/Massage
--



Wed, 25 Dec 1996 14:16:39 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Replaceing CUROBJ with WHAT?? in Visual Foxpro

2. Why am I doing a Table Scan?

3. Why is the query doing this?

4. Why is sp doing a Table Scan?

5. why is this doing this?

6. help figuring out why query doing full table scan

7. Why is IFMX stock doing poorly?

8. never done this NOW i know why I can't

9. dbgrid32.ocx - vsn for Access 2000

10. New Era Vsn 3.0

11. Vsn 5/7 Compatability

12. DB/2 extenders for Vsn 8.1


 
Powered by phpBB® Forum Software