Under Origin 8.0 you can do something like the following ..
(a) Open the CodeBuilder workspace
(b) Create an ?????.C file (File New in the Codebuilder menu)
(c) Copy the origin C function below to the new origin C file created
(d) Add the file to the CB workspace (Right ckick System AddFiles)
(e) Compile the Origin C file (Tools Build in the CodeBuilder menu)
string fnGetUserName()
{
char szUserName[MAX_PATH];
DWORD dwSize = MAX_PATH;
if (GetUserName(szUserName, &dwSize)==true)
{
string strTemp(szUserName);
strTemp.TrimLeft();
strTemp.TrimRight();
return (strTemp);
}
return ("");
}
Under Origin 8.0 this should compile without error.
Once this is done you can then open the Origin script window
and use LT commands like
"%P=fnGetUserName()$" to retreive the username