2.1.10.8 DefaultTemplate
Description
Origin's default template access
Syntax
int DefaultTemplate( LPSTR lpname, int nType, BOOL bGet = true, BOOL bAddExt = false )
Parameters
- lpname
- [input/output] buffer to hold template name, must be at least 54 when getting, use MAXLINE is a good idea, NULL will reset to default
- nType
- [input] one of EXIST_PLOT, EXIST_WKS, EXIST_MATRIX, and EXIST_LAYOUT, DefaultTemplate(NULL, -1) will reset all to default
- bGet
- [input] true to get and false to set
- bAddExt
- [input] when getting, option to add extention or not
Return
0 if no error, otherwise
-1 if nType is invalid
-2 if lpname is longer then internal buffer which is 50 characters
Examples
EX1
#define MAXLINE 100
void DefaultTemplate_ex1()
{
char szTemp[MAXLINE];
DefaultTemplate(szTemp, EXIST_WKS);
char szTemp2[MAXLINE];
DefaultTemplate("Table", EXIST_WKS, false);
DefaultTemplate(szTemp2, EXIST_WKS, true, true);
printf("worksheet template was %s, and has been set to %s\n", szTemp, szTemp2);
}
Remark
See Also
Header to Include
origin.h
Reference
|