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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Import Multiple ASCII
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ben_at_work

Germany
Posts

Posted - 08/31/2006 :  08:12:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 70
Operating System: Windows 2000

Hello folks.

I need help with programming in OriginC. I have experiences in C++ and didn't know such
frustrations before starting with OriginC.
But perhaps I am just too bullheaded and it is too recessed for me.

At first I wanted to automate the button "ImportMultipleASCII" for importing many, many
sdl-files. After hours of trial and error with my knowledge of C, I searched in the web
and found a good-looking code in the forum here. But it does not work in my Origin
Version.
Perhaps someone could help me. I would be so pleased!

Here is the code I found:

void importfolder(){
string strPath = "C:\\"; // change to your data path

StringArray saFiles;
FindFiles(saFiles, strPath, "asc");
if( saFiles.GetSize() < 1 )
return;

ASCIMP ascimp;
AscImpReadFileStruct(strPath + saFiles[0], &ascimp);

Worksheet wks = Project.ActiveLayer();

wks.ImportASCII(strPath + saFiles[0], ascimp);

ascimp.iMode = ASCIMP_MODE_APPEND_COLS;
ascimp.iPartial = ASCIMP_PARTIAL_YES;
ascimp.iPartialC1 = 1;
ascimp.iPartialC2 = 1;

for(int i = 1; i < saFiles.GetSize(); i++ )
wks.ImportASCII(strPath + saFiles[i], ascimp);
}

In my Version StringArray, FindFiles and ImportASCII does not exist.
I tried to substitute them, but I failed...
Do you have a hint for me?

Sincerely,
Ben

Mike Buess

USA
3037 Posts

Posted - 08/31/2006 :  08:28:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Ben,

The function compiles fine in 7.0 SR4 so you just need to apply the SR4 patch. Run Help > Check for Updates or find the patch here...

http://www.originlab.com/index.aspx?s=9&lm=76

Mike Buess
Origin WebRing Member
Go to Top of Page

ben_at_work

Germany
Posts

Posted - 08/31/2006 :  09:10:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your help.

I did not find an update SR4 for Origin7.0, only
for Origin7.5. Does it work?

Ben
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 08/31/2006 :  10:44:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
>>If you don't see the service release you need, browse through the complete list of patches.

Mike Buess
Origin WebRing Member
Go to Top of Page

ben_at_work

Germany
Posts

Posted - 09/05/2006 :  03:39:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello.

While updating there were a lot of notes like:
"Old file not found. However, a file of the same name was found.
No update done since file contents do not match." and
"Old file does not exist."

And now, more errors emerge after updating the system with the
German Patch 4. And while trying to compile the import routine (s.u.)
these errors ocured:

"compiling...
sys_utils.c
C:\Programme\OriginLab\Origin7\OriginC\system\graph.h(1720) :Error, class/struct not found:
C:\Programme\OriginLab\Origin7\OriginC\system\graph.h(1720) :Error, data type declaration error
C:\Programme\OriginLab\Origin7\OriginC\system\Wksheet.h(22) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\system\data.h(22) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\system\utilities.h(22) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\originlab\sys_utils.c(15) :Error, include file compilation error
compiling...
import.c
C:\Programme\OriginLab\Origin7\OriginC\system\data.h(1388) :Error, illegal function argument type
C:\Programme\OriginLab\Origin7\OriginC\system\data.h(1388) :Error, syntax error in variable declaration.
C:\Programme\OriginLab\Origin7\OriginC\system\graph.h(22) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\system\wksheet.h(22) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\system\origin.h(16) :Error, include file compilation error
C:\Programme\OriginLab\Origin7\OriginC\import.c(15) :Error, include file compilation error"

What now? Shall I install my original Origin new?
Go to Top of Page

ben_at_work

Germany
Posts

Posted - 09/05/2006 :  03:45:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
and the worst happened as well!!!!!

My template library does not work any more!!!!!!!



Go to Top of Page

ben_at_work

Germany
Posts

Posted - 09/05/2006 :  03:51:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
forget about it.

I updated a English version with a German Patch....


Mea culpa!
Go to Top of Page

ben_at_work

Germany
Posts

Posted - 09/05/2006 :  04:07:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
even the routine was compiled...



sometimes problems are solved by themselves!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000