How To Pass Data to Microsoft Graph ProgramaticallyLast reviewed: August 13, 1997Article ID: Q129533 |
3.00 5.00 | 3.00b
WINDOWS | MACINTOSHkbinterop kbcode kbole The information in this article applies to:
SUMMARYThe APPEND GENERAL command in Visual FoxPro contains a new clause (DATA) that allows you to send data to a Microsoft Graph object programatically in a General Field. This article shows by example how to use it.
MORE INFORMATIONData sent to Microsoft Graph must be in standard clipboard format. That is, fields must be separated by Tab characters, and records must be separated by carriage returns. The following sample code uses two tables (Datafile and Grphfile):
FCOUNT(<tablename>) Sample Code
#DEFINE cr CHR(13) #DEFINE tab CHR(9) USE datafile IN 1 USE grphfile IN 2 SELECT datafile cGraphString = "" * Build tab-delimited string of field names: FOR iCounter = 1 TO 5 cGraphString = cGraphString + FIELDS(iCounter) ; + IIF(iCounter < 5,tab,cr) ENDFOR * Concatenate the data, converting numeric fields to character: SCAN FOR iCounter = 1 TO 5 cGraphString = cGraphString + IIF(TYPE(Fields(iCounter))='C',; EVALUATE(FIELDS(iCounter)) ; ,str(EVALUATE(FIELDS(iCounter)),16,2); ); + IIF(iCounter < 5,tab,cr) ENDFOR ENDSCAN SELECT grphfile APPEND GENERAL mgraph DATA cGraphStringNOTE: Under Windows 95 and Windows NT, adding the clause CLASS "MSGraph" to the APPEND GENERAL command causes a new, default graph to be created regardless of any existing graph or other type of object stored in the mgraph field (including if it were empty). You may pass data to a graph object without overwriting the existing formatting by omitting the CLASS clause as above. Using the following code in the above example creates a new graph under Windows 95 or Windows NT, rather than placing the data into the existing graph:
APPEND GENERAL mgraph CLASS "MsGraph.Chart" DATA cGraphString |
Additional reference words: 5.00 VFoxMac 3.00b 3.00 VFoxWin OLE Chart
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |