RTL Constant Value NOT FOUND! 
Author Message
 RTL Constant Value NOT FOUND!

In one of my multi-record forms, the detail table  field has a table
lookup on it (Lookup Type: All corresponding fields; Lookup Access:
Help and Fill).  If the user chooses to not invoke this (CTRL +
SPACEBAR), and instead manually enters a value, I built code to test
for the "peFieldNotInLookupTable" error constant (value = 9736), in
order to return a custom error message in a dialogue box.

However, the constant returned when I invoke constantValueToName
method is "N/A", with a value of -31201.  In other words, the constant
is NOT found.

Is this something to do with how a table lookup works on the
underlying table, and not the table object?  And how can I make this
work without attaching a tcursor /table variable and doing a scan  or
qLocate?

Any help would be appreciated.

James



Wed, 08 Jul 1998 03:00:00 GMT
 RTL Constant Value NOT FOUND!

Quote:

>In one of my multi-record forms, the detail table  field has a table
>lookup on it (Lookup Type: All corresponding fields; Lookup Access:
>Help and Fill).  If the user chooses to not invoke this (CTRL +
>SPACEBAR), and instead manually enters a value, I built code to test
>for the "peFieldNotInLookupTable" error constant (value = 9736), in
>order to return a custom error message in a dialogue box.

>However, the constant returned when I invoke constantValueToName
>method is "N/A", with a value of -31201.  In other words, the constant
>is NOT found.

>Is this something to do with how a table lookup works on the
>underlying table, and not the table object?  And how can I make this
>work without attaching a tcursor /table variable and doing a scan  or
>qLocate?

>Any help would be appreciated.

>James

As I recall, the constantValueToName method accepts a parameter, indicating
the _class_ of the constant.  Are you using the correct class?

The following code extract, part of an action() method, helps determine the
class of an eventID:
var
        szWork, szClass String
endvar
        constantValueToName("ActionClasses",eventInfo.actionClass(),szWork)
        szWork.match("..Action",szClass)
        szClass = "Action"+szClass+"Commands"
        ConstantValueToName(szClass,eventInfo.ID(),szWork)

You might try another approach; in the field's changeValue method, try
the isValid method:
method changeValue(var eventInfo ...)
var
   tc tCursor
endvar
   tc.attach(self)
   if not tc.isValid("my field name",eventInfo.newValue()) then
      ; error handling
   endif

I'm not sure if the isValid method checks table lookups.  It may not
(it does check to ensure the value matches any pictures defined for
the field).

Hope this helps.

Jim



Fri, 10 Jul 1998 03:00:00 GMT
 RTL Constant Value NOT FOUND!
: In one of my multi-record forms, the detail table  field has a table
: lookup on it (Lookup Type: All corresponding fields; Lookup Access:
: Help and Fill).  If the user chooses to not invoke this (CTRL +
: SPACEBAR), and instead manually enters a value, I built code to test
: for the "peFieldNotInLookupTable" error constant (value = 9736), in
: order to return a custom error message in a dialogue box.

: However, the constant returned when I invoke constantValueToName
: method is "N/A", with a value of -31201.  In other words, the constant
: is NOT found.

: Is this something to do with how a table lookup works on the
: underlying table, and not the table object?  And how can I make this
: work without attaching a tcursor /table variable and doing a scan  or
: qLocate?

Somehow lookup tables bypass changevalue and enwvalue methods. Don't ask
me why, but they do. WHich means your code was never called, thus "n/a".

--
=========================================================================
Kasey K. S. Chang (a guy)             | Paradox for Windows Programmer

URL> http://userwww.sfsu.edu/~kschang | X-COM Guru   General PC expert
--------------------------------------+----------------------------------
Editor of XCOM and XCOM2 UN-official Strategy Guide -- FREE!  (See URL)



Sat, 11 Jul 1998 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Help me find some constant values, please!

2. where to find declaration values for constants defined in OLE DB for OLAP specs

3. default values; assigning constant values in XDR Schemas

4. Find where values are not equal between rows

5. finding field values that are not null

6. Help Please - .Find method will not return the first value in a table

7. Finding Not Null values in a table

8. SQL: how to find values NOT in a table

9. How to compare a string value measure with constant

10. Update part of a field with a constant value

11. Char with ASCII value 0 causes unterminated string constant

12. How to...make and use constant values


 
Powered by phpBB® Forum Software