Re: fields in a cursor



Jack,
Thank you for your reply, I ended up doing the same thing and got it to
work. I used the iif to check if a field is character or numeric, didn't
think about using transform though. It took me a while to realize that the
different data types were causing the problem.

Thanks again,

HME

--


---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"

Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com


"Jack Jackson" <jacknospam@xxxxxxxxxxxxxxx> wrote in message
news:nnri42tsdeco9i4v00o98jue1jop9nksgi@xxxxxxxxxx
On Fri, 21 Apr 2006 19:10:22 -0400, "HME" <helassaad@xxxxxxxxxxx>
wrote:

Bernhard,

I tried those and still getting errors.

This is part of my logic:

Select tempartcondition
** get the count of fields in the cursor
fldcnt=Fcount("tempartcondition")-1 && ignore the last field - it is
total
and not needed for the graph
cgdata=""
For i = 1 To fldcnt
cgdata=cgdata+Field(i,"tempartcondition",0)+CHR(9) && get field
names
from table or cursor
Next i
cgdata=cgdata+CHR(13)+CHR(10)
FOR i = 1 TO 3
For j = 1 To fldcnt
lcField = "tempartcondition." + field(j)
lxValue = &lcField
cgdata=cgdata+("&lxvalue")+CHR(9) && this is where I tried all
you
gave me and none worked, some of the fields are numeric and others are
Character
Next j
cgdata=cgdata+CHR(13)+CHR(10)
NEXT i

Thank you,

HME

You need to get the field contents as character datatype, regardless
of the actual data type. TRANSFORM() will do that for you. If you
don't like what it does, or if you need this for a version of VFP that
doesn't have TRANSFORM(), you will need to write your own code that
converts each possible data type to character.

FOR i = 1 TO 3
For j = 1 To fldcnt
cgdata=cgdata+transform(evaluate("tempartcondition." +
field(j)))+CHR(9)
Next j
cgdata=cgdata+CHR(13)+CHR(10)
NEXT i


.



Relevant Pages

  • Re: fields in a cursor
    ... ** get the count of fields in the cursor ... For i = 1 To fldcnt ... You need to get the field contents as character datatype, ... TRANSFORM() will do that for you. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Help Extracting Numbers formula
    ... way to tell that they're numeric numbers (data type: ... Microsoft Excel MVP ... find formula to pull out a number from a text string, ... starting from the leftmost character. ...
    (microsoft.public.excel.misc)
  • Re: How can I get Atributes from the field of the table via VBA
    ... because each character can hold any character in the double-byte ... I think is data type in code ... "Brendan Reynolds" wrote: ... Dim tdf As DAO.TableDef ...
    (microsoft.public.access.adp.sqlserver)
  • Re: inserting a date variable into a foxpro db
    ... you're sending a Date data type and not characters or a DateTime data type. ... in SQL Pass-through the way to represent a Date in a text string is to ... surround it with curly brackets. ... when one of your values is a character string. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Performing expression on all (varying number of) fields
    ... TRANSFORM CLng,0)) AS CountOff5 ... The CLngtypecasting helps Access get the data type right. ... where Audit is the table being queried. ...
    (microsoft.public.access.queries)