CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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)
by Meg   February 02, 2012 @ 6:37pm
Tags:
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
by Dan   February 01, 2012 @ 11:51pm
Tags:
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
by Rick Strahl   September 23, 2011 @ 12:38am
Tags: Email, Outlook
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
by Matt Slay   June 10, 2011 @ 11:44am
Tags:
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
*-------------------------------------------------------------------------------------------------------
 
by Matt Slay   April 13, 2011 @ 7:57am
Tags:
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)
by Matt Slay   March 23, 2011 @ 8:25am
Tags:
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
*---------------------------------------------------------------
by vlad tamas   March 01, 2011 @ 2:33am
Tags:
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
by vlad tamas   December 10, 2010 @ 3:19am
Tags:
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)
by vlad tamas   December 09, 2010 @ 8:44am
Tags:
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
by vlad tamas   December 08, 2010 @ 8:32am
Tags:
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
by vlad tamas   December 08, 2010 @ 7:14am
Tags:
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 
by vlad tamas   October 20, 2010 @ 1:10pm
Tags:
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'
by vlad tamas   October 20, 2010 @ 1:00pm
Tags:
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.)
by Matt Slay   September 09, 2010 @ 8:13pm
Tags:
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))
by vlad tamas   May 25, 2010 @ 6:57am
199 Views
no comments
 
SELECT wire_inv
SEEK(cSpool_no)
 
IF !FOUND()
    RETURN .F.
ELSE
    qty_prior = Wire_Inv.Qty
ENDIF
 
IF USED("csEmpNoOut")
by vlad tamas   April 22, 2010 @ 9:47am
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
by vlad tamas   April 15, 2010 @ 5:11am
Tags: RFQ
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
by vlad tamas   April 12, 2010 @ 12:01pm
Tags: intelex
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
by vlad tamas   April 12, 2010 @ 11:51am
Tags: intelex
192 Views
no comments
 
SET EXCLUSIVE OFF
 
crfqno = INPUTBOX("Enter RFQ number.", "cRFQno", "")
 
IF EMPTY(crfqno)
    RETURN
ENDIF  
 
IF USED('csSupplier')
   USE IN csSupplier
by vlad tamas   April 12, 2010 @ 7:52am
Tags: rfq
208 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate