Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rewrite
Message
From
23/01/2007 01:50:14
 
 
To
22/01/2007 14:15:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01187577
Message ID:
01187980
Views:
23
hi,
thank you for reply,
i try as under i get error message ??at this line
insert in newcurbilldata from memvar&&Command contains unrecognized phrase/keyword


remark:
mytable curbilldata most of fields as numaric type,i use the function under to convert it to time ,for that i need to create new table have the same names of fields but the type is characters
CLOSE all
**create cursor from a file
USE curbilldata && Open table.

gnFieldcount = AFIELDS(gaMyArray) && Create array.
clos data
CREATE CURSOR newcurbilldata FROM ARRAY gaMyArray
sele 0
use curbilldata
scan
scatter to memvar
insert in newcurbilldata from memvar&&Command contains unrecognized phrase/keyword 
endscan




CLOSE ALL


**********************************************************************
USE newcurbilldata
gcDelimName = ALIAS( ) + '.xls'
gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
IF EMPTY(gcDelimFile)
   CANCEL
ENDIF
COPY  TO (gcDelimFile) XL5

**************************************************************************
FUNCTION Sec2Str(tnSeconds, llDays)

LOCAL lcHH, lnTm, lcMM, lcSS, lcTime
lnTm = tnSeconds
IF llDays
   lcDD = TRANSFORM(INT(lnTm / 86400), "99") + " "
   lnTm = tnSeconds % 86400
   lcHH = TRANSFORM(INT(lnTm / 3600), "@L 9999")
ELSE   
   lcDD = ""
   lcHH = TRANSFORM(INT(lnTm / 3600), "@L 99999")
ENDIF 
lnTm = lnTm % 3600
lcMM = TRANSFORM(INT(lnTm / 60), "@L 99")
lcSS = TRANSFORM(INT(lnTm % 60), "@L 99")
lcTime = lcDD + lcHH + ":" + lcMM 
*lcTime = lcDD + lcHH + ":" + lcMM + ":" + lcSS
RETURN lcTime
thanks.
>Try this one . . .
>
>**create cursor from a file
>USE curbilldata && Open table.
>
>gnFieldcount = AFIELDS(gaMyArray) && Create array.
>clos data
>CREATE CURSOR newcurbilldata FROM ARRAY gaMyArray
>sele 0
>use curbilldata
>scan
> scatter to memvar
> insert in newcurbilldata from memvar
>endscan
>
>
>** then select newcurbilldata
>** copy to ??? xls etc..
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform