Two examples working with MarcEdit 5.0’s new COM

MarcBreaker Example:

Dim objMARC

Set objMARC = CreateObject(“MARCEngine5.MARC21”)

‘These files are not provided. You will need to use your own test files. This example is only to show syntax.

lret = objMARC.MarcFile(“C:\Documents and Settings\reeset\Desktop\cyrillic.mrc”, “C:\Documents and Settings\reeset\Desktop\cyrillic.mrk”)

msgbox “here”

The above is the general MarcBreaker function.  This will work with either MARC-8 or the UTF-8 characterset.  If you want to change the characterset, you would utilize the MarcFileEx function which includes a third parameter which specifies the output characterset. 

MarcMaker Example:

Dim objMARC

Set objMARC = CreateObject(“MARCEngine5.MARC21”)

‘These files are not provided. You will need to use your own test files. This example is only to show syntax.

lret = objMARC.MMaker(“C:\Documents and Settings\reeset\Desktop\cyrillic.mrk”, “C:\Documents and Settings\reeset\Desktop\cyrillic.mrc”)

msgbox “here”

Like the function above, this accesses the general MarcMaker function.  This function will work with the MARC-8 or UTF-8 characterset.  If you want to specify a characters, there is a second function, MMakerEx that includes a third parameter that specifies characterset.

Folks might be wondering why I wouldn’t just use two functions with optional parameters (rather than creating a basic and extended version of the functions) — well, its because C# (the language MarcEdit is written in), does not consume parameters marked as Optional (even though the Optional Attribute is valid within the language).  So I’ve worked around it.

–Terry


Posted

in

by

Tags: