Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info.
Please enter one or more search terms:
search (case insensitive):

order by:

SEARCH RESULT Results 1 - 25 of 941 for FCOUNT. (1.0763862 seconds)

'photo' must be 'PHOTO'
Thread ID: 14770 John Zylstra 'photo' must be 'PHOTO' Dear John I have copied your program and it works like a charm ,with a little modification. Try this : thisform.AddObject('grid1','grid') thisform.grid1.height=350 thisform.grid1.width=700 thisform.grid1.left=30 thisform.grid1.top=30 thisform.grid1.recordmark=.t. thisform.grid1.deletemark=.f. thisform.grid1.headerheight=28 select dbs_1 n=1 i=1 FOR n=1 TO FCOUNT() IF FIELD(n)<>'PHOTO' && <==== 'photo' must be 'PHOTO' * thisform.grid1.addcolumn(i) thisform.grid1.columncount=i ii=ALLTRIM(STR(i)) thisform.grid1.Column&ii->controlsource=FIELD(n) thisform.grid1.Column&ii->text1->width=FSIZE(FIELD(n)) thisform.grid1.Column&ii

adding records through a cursor adaptor
Thread ID: 163092 Bob Gatto adding records through a cursor adaptor Hello One And All, I'm trying to add a record to an SQL server table. I have a cursor adaptor for the SQL table. I have the fields in the SQL side setup as NOT NULL. It's possible the user might not fill in all the fields. This I know resulds in NULL fields for the table. In my save routine I have code like this: SELECT listener_tmp FOR j1 = 1 TO FCOUNT("listener_tmp") vfld = FIELD(j1) DO CASE CASE INLIST(TYPE(vfld),"C","M") vcomm = "replace "+vfld+" with "+IIF(ISNULL(&vfld),'',&vfld)+" in listener_tmp" CASE INLIST(TYPE(vfld),"N","I") vcomm = "replace "+vfld+" with "+IIF(ISNULL(&vfld),"0",ALLTRIM

Alter Table Problem
Thread ID: 64873 Daniel Hofford Alter Table Problem Can anyone tell me why this wouldn't work? FOR i = 1 TO FCOUNT() IF LEFT(FIELD(i),3)="MNS" ALTER TABLE MailNet DROP COLUMN (FIELD(i)) ENDIF ENDFOR It works erratically for me. The table this works on has 32 fields, the last 12 have column names starting with "MNS." Dan

Alter Table TableName Drop & Cursor
Thread ID: 252749 Khurram Tahir Alter Table TableName Drop & Cursor SELECT * FROM Custcddt ORDER BY Alphcddt INTO CURSOR Tc_Tg READWRITE GO TOP IN Tc_Tg ALTER Table Tc_Tg DROP COLUMN DLTD ALTER Table Tc_Tg DROP COLUMN MARK ALTER Table Tc_Tg DROP COLUMN NMRCCD oPFP1 = Thisform.Pgf1.Page1 oGrid1 = Thisform.Pgf1.Page1.Grid1 WITH oGrid1 .RecordSource = 'Tc_Tg' .ColumnCount = FCOUNT('Tc_Tg') .SetAll('FontSize',8,'Header') .SetAll('FontName','Times New Roman','Header') .SetAll('FontItalic',.t.,'Header') .AutoFit() .ReadOnly = .T. .LockColumns = 2 .SetFocus() ENDWITH I put above code in init event of form Problem: After quiting form i run again

argh! running an excel macro from foxpro
, *!* *!* integer, and/or currency data. *!* lcTotalRangeExpr = ; ["A1:] + ColumnLetter(FCOUNT()) + ALLTRIM(STR(RECCOUNT() + 3)) + ["] lcTotalPrintArea = ; ["$A$1:$] + ColumnLetter(FCOUNT()) + [$]+ALLTRIM(STR(RECCOUNT() + 3)) + ["] *!* The following code will erase any previously created temporary excel *!* *!* file created by this program *!* ERASE

ASK tushar
Thread ID: 272577 Anh Phuc ASK tushar Dir Tushar Please help me, i want code sum with dinamic cursor the cursor was create when Custom define example cursor is: *MY TEST CREATE CURSOR Dyna_MyCursor(Quantity N(10),Price n(10),Cost N(10)) _quan=100 _Price=100 SELECT Dyna_MyCursor FOR i=1 TO 5 APPEND BLANK replace Quantity WITH _quan,price WITH _price _quan=_quan+100 _Price=_Price+100 ENDFOR replace cost WITH Quantity*Price all brow *HOW TO SUM WITH DON'T KNOW WHAT FIELD NAME *PLESE CORECT ME THIS CODE OR SUGGEST ME ANY THING LOCAL ARRAY aFieldInfo(1) SELECT Dyna_MyCursor nFields = AFIELDS(aFieldInfo,"DyNa_Mycursor") k=FCOUNT("Dyna_MyCursor") sele Dyna_MyCursor append blank FOR i

Automation Excel Grafic Engine
Thread ID: 285388 Ron Herings Automation Excel Grafic Engine Dear all, I have written a program to produce automatically grafs in excel. Does anybody know how the graph can be saved to disk as jpg or BMP. My question pertains to the last line of this code example. regards * your code here * your code here Message ID here OEXCEL = createobject("Excel.Application") OEXCEL.visible = .t. && for debugging OWORKBOOK= OEXCEL.WORKBOOKS.add() OEXCEL.WORKBOOKS.add() OSHEET = OEXCEL.ACTIVESHEET ** Read file into an excel sheet use (MFILE) *Recode headers and fill cells in excel sheet MF=fcount() for J=1 to MF OSHEET .CELLS(1,J).value = field

Base64 encoding and Field size
() =0 Return 0 Endif If lBase64=.T. Select &cCursor For fc=1 to fcount() If Type(Field(fc)) == 'C' or Type(Field(fc)) == 'M' Campo=Field(fc) Replace &cCursor..&Campo With Strconv(Alltrim(&cCursor

Blank records
Thread ID: 73239 Jim Hawkins Blank records I have a function to test if the current record in a table is blank :- func BlankRec private J, MT MT=.t. scatter to TEST for J=1 to fcount() MT=MT and empty(TEST[J]) endfor release TEST return MT So I can find if a table contains blank records by:- scan if BlankRec() wait wind str(recno()) endif endscan This is okay for small tables, but is there a quicker way to locate blank records in big tables ? Jim Hawkins

Change the column name of Cursor
Thread ID: 261569 Prashant kulkarni Change the column name of Cursor Dear Experts I am trying to change the column name through coding My Table contains the data in this manner Item code D_20090401 D_20090501 D_20090601 D_20090701 XYZ 100 200 300 400 ABC 50 60 70 80 Not i want to change the column Name( D_20090401,D_20090501,D_20090601,D_20090701) Now i want to change the column Name Like Apr2009,May2009,june2009 I tried the following Code , but unfortunately it does not work. SET STEP ON SELECT final GO top For I = 2 to FCOUNT()-1 Selestring='' GO top Selestring=RIGHT(FIELD(I),8) Selestring2=LEFT(Selestring,6) *=MESSAGEBOX

Code for tableupdate and log
) lcFldList = GetUserChanges() For lnCnt = 1 To Fcount() lcFldName = Field( lnCnt ) luCurVal = Curval( Field( lnCnt )) luOldVal = Oldval( Field( lnCnt )) luUsrVal = Eval( Field( lnCnt )) If luCurVal == luOldVal...()" Endif lcFldState = Substr( lcFldState, 2 ) For lnCnt = 1 To Fcount() lcStatus = Substr( lcFldState, lnCnt, 1 ) If Inlist( lcStatus, "2", "4" ) lcRetVal = lcRetVal + Iif( ! Empty( lcRetVal ), ",", "") + Field( lnCnt

color grid cell- dynamic columns
("DBF","Select the Table:") use (lcfilename) again in 0 shared endif lcalias = alias() with this.grgrp .recordsource = "" .recordsource = lcalias select (lcalias ) ifcount= fcount() for i = 1 to ifcount if .columncount... value *!* endif endfor for i = fcount() + 1 to .columncount .removeobject("Column"+alltrim(str(i))) endfor .setall("dynamicbackcolor", ; "IIF(RECNO()%2 = 0,RGB(204,255,153), RGB(255,255,255))", "Column") .refresh

conditional FCOUNT
Thread ID: 335701 andrew kabz conditional FCOUNT Hello Experts, I have this routine f= FCOUNT('table1') && can also use afields() FOR i=1 TO f a[i]=field[i] ENDFOR LIST OFF ID,sp_no FOR B.STUDY_ID=' ' INDEX ON SP_NO TAG P_NO ADDITIVE FOR i=1 TO f ? a[i]+" DIFFERS" ?"=====================" ENDFOR how can i do a conditional selection of fields without listing them all, i would like to eliminate about 3 fields. Thanks Regards Andrew

Cursor closed unexpectedly
Thread ID: 362038 Sithu Kyaw Cursor closed unexpectedly I have the following code snippet. It has the nested SCAN/ENDSCAN. I got an error "File is not open" error on the outer SCAN/ENDSCAN when there is more than one record. Please correct me. SELECT * FROM table1 INTO CURSOR cursor1 SCAN * Do something here lnCurrentWorkArea = SELECT(0) && save current workarea ************************************** **** The following code are in a function ************************************** SELECT 0 && Unused work area SELECT * FROM table2 INTO CURSOR cursor2 SELECT('cursor2') *** loop all field names FOR j=1 TO FCOUNT() * Do something

cursor from the rows of other cursor
where I do need the rows of first cursor as column in new cursor. Problem is that I don't know how many rows will be returned in first cursor. What I do is to fcount() of first cursor and run do case statement. select cursor1 do case case fcount()=3 create cursor cursor2 (single c(20),double c(20),queen c(20)) case fcount()=4 create cursor cursor2 (single c(20),double c(20),queen c(20),king c(2)) case fcount()=5 create

Cursor to Excel via arraay
Thread ID: 300454 Mike James Cursor to Excel via arraay I've been using Cetin Basoz' VFP2Excel function as my default transfer method, but recently worked on an alternative using arrays. This only transfers data, ie no column headings, but I often create custom headings anyway. A brief search didn't turn up any examples like this, what do others think? Seems fast; any disadvantages? * How many records and fields are there? gnfieldcount = FCOUNT(‘tmptable’) gn_rows = RECCOUNT(‘tmptable’) * Create array from cursor DIMENSION ga_table(gnfieldcount, gn_rows) SELECT * FROM tmptable; INTO ARRAY ga_table * Copy array to Excel * (other automation code omitted) WITH loExcel.Selection.Resize

="" fieldstoupdate="" FOR i = 1 TO fcount(cname) fieldlist=fieldlist+FIELD(i)+"," && I'm composing a string like "field1,field2,..field(n)" fieldstoupdate=fieldstoupdate+FIELD(i)+" "+ctable+"."+FIELD(i)+"," && I'm

Dbf to Html
Thread ID: 126228 Tariq mehmood Dbf to Html Dear Experts I convert dbf to html with following procedure. Is it possible to apply format in columns e.g. all numeric columns shlould appear as Alignment=right fontname=arial fontsize=10 inputmask=99,99,999 Please help SET SAFETY OFF USE ? als1=alias() IF !empty(als1) lcHTML=alias() + '.Htm' SET textmerge to (m.lcHTML) noshow SET textmerge on \\ \ \ \ FOR ix=1 to fcount() IF type(field(m.ix)) != 'G' \<> ENDIF ENDFOR \ SCAN \ FOR ix=1 to fcount() IF type(field(m.ix)) != 'G' \<> ENDIF ENDFOR \ ENDSCAN \ \ \ SET textmerge to SET textmerge off

DBF to SQL Part 2
record ] + TRANSFORM(RECNO()) + [/] + cRecCount NOWAIT Cmd = [INSERT INTO ] + ALIAS() + [ VALUES ( ] FOR I = 1 TO FCOUNT() fld = FIELD(I) IF TYPE(Fld) = [G] LOOP ENDIF dta = &Fld typ = VARTYPE

DBF to SQL Part 3
WINDOW [Loading record ] + TRANSFORM(RECNO()) + [/] + cRecCount NOWAIT Cmd = [INSERT INTO ] + ALIAS() + [ VALUES ( ] FOR I = 1 TO FCOUNT() fld = FIELD(I) IF TYPE(Fld) = [G] LOOP ENDIF dta = &Fld

Dynamic Grid
Thread ID: 86532 Daniel Hofford Dynamic Grid If I put "this.ColumnCount=FCOUNT()" in a grids init, is there a way for my to dynamically populate that grids header dblclick method? Thanks, Dan "Our gold does not chink and glitter. It gleams in the sun and neighs in the dark." Chief Joseph

Thread ID: 390048 Tasadduq Hussain DynamicForeColor Hi everyone i'm trying to set DynamicForeColor for individual columns but getting error "Expression is Invalid ..." FOR lnX=4 TO FCOUNT() - 2 lcColumn="column"+ALLTRIM(STR(lnX)) thisform.testGrid1.&lcColumn..DynamicForeColor = "iif(EVALUATE(FIELD(lnX))<50,255,0)" ENDFOR but if try this code then it works fine thisform.testGrid1.column5.DynamicForeColor="iif(EVALUATE(FIELD(5))<50,255,0)" so any help

Excel automation errors
:] + ColumnLetter(FCOUNT()) + ALLTRIM(STR(RECCOUNT() + 3)) + ["] lcTotalPrintArea = ["$A$1:$] + ColumnLetter(FCOUNT()) + [$]+ALLTRIM(STR(RECCOUNT() + 3)) + ["] ERASE HOME() + "VFP_to_Excel.xls" COPY TO HOME() + "VFP_to_Excel

Excel Print
= ["A1:] + ColumnLetter(FCOUNT()) + ALLTRIM(STR(RECCOUNT() + 3)) + ["] lcTotalPrintArea = ["$A$1:$] + ColumnLetter(FCOUNT()) + [$]+ALLTRIM(STR(RECCOUNT() + 3)) + ["] ERASE HOME() + "VFP_to_Excel.xls" COPY TO HOME() + "VFP

Excel Text Format
Thread ID: 133413 Aloysius Lineses Excel Text Format Hi, Please help to fix the above code. I want to format the range of cell to text format. oleApp1 = GETOBJECT('',"Excel.Sheet") oleApp = oleApp1.Application oleapp.activesheet SELECT final_temp FOR i=1 TO FCOUNT('final_temp') CASE TYPE('EVALUATE(FIELD(i))')='C' oleapp.Range(oleapp.cells(5,i),oleapp.cells(RECCOUNT()+4,i)).Characters(1,FSIZE(FIELD(i))) ENDFOR Please teach me also how to format Cell Shading with specific color. Regards, Certified Greenhorn

Result Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38