The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 workbook comments

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Scomex Posted - 03/04/2013 : 11:19:22 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 8.0.63.988 SR6 (8.0988)
Operating System: Windows 7

Hi,
My aim is to import several txt files into a work book and then set the path and name of these files as comments into this workbook.

wksPg.Create();
wks0=wksPg.Layers(0);
char str_comments[10000];
ASCIMP ai1, ai2;
int nbfiles;
StringArray icspath;
nbfiles = GetMultiOpenBox(icspath, "*.txt");
if(nbfiles>0)
{
printf("%d files :\n",nbfiles);
for(index =0; index<nbfiles; index++)
{
if(AscImpReadFileStruct(icspath[index], &ai1)==0)
{
strcat(str_comments, icspath[index]+"\n");
ai1.iMode = ASCIMP_MODE_APPEND_COLS;
ai1.iRenameCols = 0;
wks0.ImportASCII(icspath[index], ai1);
wks0.AutoSize();
}
wksPg.SetComments(str_comments);
}
}
else
{
printf("no file !");
}

The problem is that even if I write "\n" in the string concatenation, the final comment is on a single line. For easier reading, I would rather have a new line for each string containing the filename.
Another thing is that the workbook and the worksheet get the name of the final imported file and I don't know how to keep a constant worksheet name.
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 03/04/2013 : 9:09:47 PM
Hi,

1. Please use "\r\n" instead to display as a new line.

2. See ASCIMP structure, need to set iRenameWks to 1, such as

ai1.iRenameWks = 0;


Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000