Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Win10
Hello,
I have many workbooks separated into 2 types of short name: the first starts with an At, the second starts with an Ox.
I would like to create 2 different string arrays: one for At workbook names, and another for Ox.
To test my code, I created a project with 1 At workbook and 1 Ox workbook only. I have tried the following:
doc -e W
{
string sName$ = page.name$; //Example: A550C360d0p5z
string sNameAt$;
string sNameOx$;
if (Left(sName$,1)$ == "A") sNameAt$ = sName$;
if (Left(sName$,1)$ == "O") sNameOx$ = sName$;
ArrSampAt.Add(sNameAt$);
ArrSampOx.Add(sNameOx$);
}
What I got was: both arrays had 2 entries: one empty, and the other one with the correct name.
Why is this happening?
Is there a simpler way to achieve this? I thought it might be simpler to collect all workbook names in an array to later separate them in two groups, so that Origin would only work with text entries instead of looping through books (which should be easier?), but I can't seem to make it work. Maybe I am overthinking.