Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing
Message
 
À
06/12/2014 03:50:27
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01610714
Message ID:
01611944
Vues:
94
tnx Al
I was trying to get this done in a one line command as tamar had done with his seek() ex..
the locate does not work as shown in below ex. --- worth the try thanks for that.
IF locate ("H", "allocate", "collterm")       
 **** test for left letter h in field collterm in database allocate
endif
>If you don't have or want an index, LOCATE can help:
>
>SELECT Allocate
>LOCATE FOR LEFT( Allocate.CollTerm, 1 ) == "H"
>
>IF FOUND( "Allocate" )
>... etc.
>
>ELSE
>... the record pointer is moved to EOF()
>
>ENDIF
>
>>Sorry my mistake - obviously scan will not work - I was trying to bypass indexing issue - but in the current context there is no way to complete scan processing and exit. So back to seek(). If I open the database before hand and index then issue your command lines it works but I thought your intention was to eliminate the need for activating the index (order) and opening the database. At any rate I have found an easy way to access the information I need - I am just curious in future how I would get this to work.
>>
>>>HI Tamar
>>>I like your option for a quick search but am not having success with it - can you tell me what i'm doing wrong.
>>>on page 26 you write
>>>
>>>IF SEEK("      10313", "Orders", "OrderDate")    
>>>* Process records for this date 
>>>ENDIF
>>>
>>>
>>>I have a database with one record - I am trying to test for a name starting with H in a field called collterm in a db called allocate.
>>>since it's not indexed I used scan which should have same result showing up- neither scan nor seek yield the correct result.
>>>
>>>IF scan("H", "Allocate", "Collterm")      
>>>*** letter found or not
>>>ENDIF 
>>>
>>>
>>>tnx for any help on this.
>>>
>>>k
>>>
>>>>>Yes I tried both and they both work. I am not familiar with padr and it's missing from my vfp help. is it pad right?
>>>>
>>>>Karen - if you're not familiar with PADR(), there may be other additions you missed along the way. You might find my paper http://www.tomorrowssolutionsllc.com/Conference%20Sessions/We%20Used%20to%20Do%20it%20That%20Way%20But.pdf useful.
>>>>
>>>>Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform