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
 Extending/Wrapping GetFilenamesInFolder()

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
cdrozdowski111 Posted - 02/14/2013 : 1:20:47 PM
Hello,

I have developed an custom Origin C function that wraps the Origin C function GetFilenamesInFolder().

I have done this for two reasons:

1) To modify the ref string containing the list of files generated by GetFilenamesInFolder(). My function changes the separator from "|" to "\r\n".
2) To make the functionality of GetFilenamesInFolder() available to LabTalk.

Can someone take a look at my code below to make sure it is kosher? It does compile and runs when called from LabTalk.



int myGetFilenamesInFolder(string& strFilenameList, string strPath = "", string strFilter = "", int nRecursive = 0, int nDisplayOptions = 0)
{
int nRetOK = 0;

BOOL bRecursive = (nRecursive > 0 ? TRUE : FALSE);
UINT uDisplayOptions = (nDisplayOptions > 0 ? nDisplayOptions : 0);

// GetFilenamesInFolder() puts the list of files found in strFilenameList separated by "|"
nRetOK = GetFilenamesInFolder(strFilenameList, strPath, strFilter, bRecursive, uDisplayOptions);

// Replace "|" separator in strFilenameList with "\r\n"
strFilenameList.Replace("|", "\r\n");

return nRetOK;
}
2   L A T E S T    R E P L I E S    (Newest First)
cdrozdowski111 Posted - 02/15/2013 : 8:53:53 PM
Thank you.
Penn Posted - 02/15/2013 : 8:14:23 PM
Hi,

I have tried your code, it works after compiling done, in LabTalk like

string str$;
myGetFilenamesInFolder(str$);
str$ = ;


Penn

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