John,
Check out Sys(14).

However, always remember though that there is no such thing as a "Numeric"
index as all the data you index on is converted to a character expression
before it is indexed. Hence you can seek on a character key even though you
created the index as a "numerical index"

See Example below:

Close Tables all

Create Cursor curtemp (ID C(10), balance N(9,0))

Insert Into curTemp Values  ("A01",10)
Insert Into curTemp Values  ("B01",20)
Insert Into curTemp Values  ("C01",30)
Insert Into curTemp Values  ("D01",40)

Index on balance Tag balance

vKey=10
seek vKey order tag Balance
*
If Not Found()
  =MessageBox("Numeric Key"+Transform(vKey)+" Not There")
Else
  =MessageBox("Numeric Key"+Transform(vKey)+" Found")
Endif

vKey=Str(10,9,0)
*
seek vKey order tag Balance
*
If Not Found()
  =MessageBox("String Key"+vKey+" Not There")
Else
  =MessageBox("String Key"+vKey+" Found")
Endif

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of John J. Mihaljevic
Sent: 16 January 2007 18:50
To: profox@leafe.com
Subject: Determining the type of active index

Hi all,

I've got a Search box on my form that will let the user search the active
table based upon whatever the current sort order is (the currently active
index tag).  For example, my Customers table.

I want them to be able to enter either a Customer Number or a Customer Name,
and have it search the table based upon whichever index tag is currently
selected.  If they enter a digit (for example, 9), I need to know if it
should be treated as a digit (for example, Customer Number 9) or a character
(for example, "9 Industries") depending on what the currently active index
order is.

Using vartype() for the fields Name or Number wouldn't be good enough
because the current index tag may be comprised of more than one field that
aren't all numeric or all character.

Thanks much,

John
"The difference between a successful person and others is not a lack of
strength, not a lack of knowledge, but lack of will." - Vince Lombardi

* All mail scanned by Norton AntiVirus.  No AV software on your computer?
Remove me from your address book, please.

* Please respect my privacy.  Do not forward my address to anyone else or
include me in emails sent to multiple recipients.  Use BCC.



[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to