Format:
Recent snippets matching language of FoxPro
t = (2) #variable to test p = [] #list of prime numbers prime_set = 0 #number of primes counted while (prime_set < 1000): #while the number of primes counted is less than 1000 test t t = t + 1 #add one to (t) to test all integers for i in range (2,int(t-1)): #see if t is evenly divisible by any number between 2 and itself-1 if (t%i) != 0: p = p + [t] #if not divisible it is prime. add t to the prime number list prime_set = (prime_set + 1) #if prime, also add one to the quantity of primes counted print prime_set #print prime_set to see how many primes have been counted (should stop at 1,000)
41 Views
no comments
PARAMETERS cDire, cMask, cAttr, cLevel * Count files in <cDire> according to <cMask> and <cType>. * cDire: directory to begin counting; empty -> current directory * cMask: mask of name counting for; empty -> all files * cAttr: attribue of files counting for; can be any combination of: * F (File), D (Directory); not present -> File * and * I (Include), E (Exclude), O (Only) the next attribute(s); not present -> Include * and * A (Archive), R (Read-only), S (System), H (Hiden); not present -> none
7 Views
no comments
FUNCTION ShowEmail( lcRecipient,lcSubject,lcBody ) RETURN GoUrl("mailto:" + lcRecipient + ; "&Subject=" + STRTRAN(UrlEncode(lcSubject),"+"," ") +; "&Body=" + STRTRAN(UrlEncode(lcBody),"+"," ")) **************************************************** FUNCTION GoUrl ****************** *** Author: Rick Strahl *** (c) West Wind Technologies, 1996
58 Views
no comments
* See blog post: http://mattslay.com/foxpro-class-to-generate-scctext-for-all-files-in-a-project/ * *=========================================================================== lnResponse = MessageBox('Run SSCText to generate ascii code files?', 3, 'Generate SCC files?') If lnResponse <> 6
254 Views
2 comments
*------------------------------------------------------------------------------------------------------- * GoFish 4 Code Search Tool for Visual FoxPro * * http://vfpx.codeplex.com/wikipage?title=GoFish *------------------------------------------------------------------------------------------------------- *-- Search Engine Sample Usage (Updated 2011-05-18) * *-- This code serves as a test suite and coding examples of how to use the GoFish Search Engine *-------------------------------------------------------------------------------------------------------
161 Views
no comments
Lparameters tcFileToEdit, tcMethod, tcClass, tnStartPosition Do case Case This.IsTextFile(tcFileToEdit) Modify Command (tcFileToEdit) Range tnStartPosition, tnStartPosition Case JustExt(tcFileToEdit) = 'SCX' lcMethod = Alltrim(CsrSummarySearchResults.name) If !Empty(lcMethod) Modify Form (tcFileToEdit) Method (tcMethod)
120 Views
no comments
.cItem = ALLTRIM(cItem) IF !USED('rl') USE config!rl IN 0 ALIAS rl ENDIF SELECT rl *--------------------------------------------------------------- *-- Copy rl structure to a temp cursor *---------------------------------------------------------------
121 Views
no comments
IF !USED('Exchange') USE iw_controls!Exchange IN 0 ALIAS Exchange ENDIF nSendUsing = Exchange.SendUsing cServer = ALLTRIM(Exchange.Server) USE IN SELECT('exchange') SELECT csRFQ_B GO TOP
149 Views
no comments
IF !USED('Exchange') USE iw_controls!Exchange IN 0 ALIAS Exchange ENDIF iMsg = CreateObject([CDO.Message]) iConf = CreateObject([CDO.Configuration]) Flds = iConf.Fields Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = Exchange.SendUsing Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 'exchange' && ALLTRIM(Exchange.Server)
140 Views
no comments
IF !USED('Exchange') USE iw_controls!Exchange IN 0 ALIAS Exchange ENDIF nSendUsing = Exchange.SendUsing cServer = ALLTRIM(Exchange.Server) USE IN SELECT('exchange') SELECT csRFQ_B GO TOP
135 Views
no comments
SELECT csRFQ_B GO TOP cdoSendUsingPort = 2 oMsg = CREATEOBJECT("CDO.Message") oConf = CREATEOBJECT("CDO.Configuration") Flds = oConf.FIELDS Flds.ITEM("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort Flds.ITEM("http://schemas.microsoft.com/cdo/configuration/smtpserver") = cMailServer Flds.ITEM("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = nsmtpconnectiontimeout
126 Views
no comments
SELECT * ; From config!part_li ; Where ALLTRIM(part_no) == ALLTRIM(NVL(cpart_no,'')) AND INLIST(ALLTRIM(type), &ctypes); Into Cursor (cResultCursor) ReadWrite nResult = _Tally IF nResult > 0 lretval =.t. ELSE
194 Views
no comments
LPARAMETERS cFile, oLog LOCAL cSourceFile, cDestinationFile, cFileNameDbf, cFileNameXls, cFilePathDbf, cFullNameDbf, cFullNameXls, cOldDefault LOCAL nImportedFields, nExpectedFields, cField, lFieldsOK, lDataOK, cItems, cParts, nItems, nParts, cImportItem LOCAL cDbfFieldName, cExpectedFieldName, cExpectedFieldType, nExpectedFieldSize, nExpectedFieldPrec, lImportTubingOK, lImportTTMLogOK LOCAL ARRAY aExpectedFields[1], aImportedFields[1], aDbfFields[1], aNumericData[1] cDestinationFile = 'tubing.dbf' cDestinationAlias = 'tubing'
166 Views
no comments
*====================================================================================== Function MigrateParts RenameTable('Part_Parts', 'PartItems') RenameTable('Part_Files', 'PartFiles') RenameTable('Part_Labor', 'PartLabor') RenameTable('Part_Mtl', 'PartMaterial') lcTableName = 'Parts' RenameColumn(lcTableName, 'ipkey', lcIdColumnName, .t.)
169 Views
no comments
LPARAMETERS cfile, olog LOCAL citems, cparts, citem, cpart, citemprev, calias, cfilen, cfilennew, nrec, nrecd, nafld, nprevsel, lcsubject, lcbody, lcbodyitems, lcbodyparts ccr= CHR(13)+CHR(10) nprevsel = SELECT() cfile = LOWER(cfile) sns = ALLTRIM(SYS(2))
199 Views
no comments
SELECT wire_inv SEEK(cSpool_no) IF !FOUND() RETURN .F. ELSE qty_prior = Wire_Inv.Qty ENDIF IF USED("csEmpNoOut")
202 Views
no comments
** cmdSend.Click() nPrevSel= SELECT() thisform.mupdatesuppliers() IF USED("csRFQSend") USE IN csRFQSend ENDIF SELECT * FROM csRFQList WHERE sel > 0 INTO CURSOR csRFQSend
202 Views
no comments
...
SELECT csRFQ_B
SCAN
Harness = ALLTRIM(csRfq_b.part_no)
*pulls revision data from Intelex first AND fill IN any others from VFP Document Tables. (DES) 9/26/08
DO Intelex_Multi_Rev WITH gcRevMemo, gcRevMemo5Col, gcRevMemo6Col, gcPlacardRevMemo
IF USED("csPart_Li") Then
SELECT csPart_li
233 Views
no comments
* This program looks up all the Rev data from Document and populates a table called REV which is stored in SYS(2023) * * It also populates the prior used Rev Var's in case a program requires them. * * Date: 5/28/2008 * By: Doug Symes * LPARAMETERS lcRevMemo AS Character, lcRevMemo5Col AS Character, lcRevMemo6Col AS Character, lcPlacardRevMemo AS Character PUBLIC cSeek, nCount, lIntelex, cSQL, nIntelexMultRevConn
192 Views
no comments
SET EXCLUSIVE OFF crfqno = INPUTBOX("Enter RFQ number.", "cRFQno", "") IF EMPTY(crfqno) RETURN ENDIF IF USED('csSupplier') USE IN csSupplier
208 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
