LibFunc and str: help

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

LibFunc and str: help

Post by kpassaur » Wed Sep 17, 2008 10:06 am

I am having trouble with a DLL that extracts text from a file. The DLL allows ASCII code numbers to be passed to it in a range for instance 48-56 as well as individual code numbers that are stacked such as 48,49,50,51 etc.

The isssue is it works fine with a range such as this

LibFunc>cretxt,DE_CustomCharacterList,result,48-56

Or with an individual code such as this

LibFunc>cretxt,DE_CustomCharacterList,result,str:49
(without the "str;" it locks up)

But with mulitble codes neither of these work

LibFunc>cretxt,DE_CustomCharacterList,result,str:49,50
or
LibFunc>cretxt,DE_CustomCharacterList,result,str:49,str:50

does anyone have any ideas

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 17, 2008 10:14 am

It would help if you provide the function spec for the DLL. str:49,str:50 is trying to send TWO parameters. I'm assuming the function expects only one. In which case try this:

Let>string_to_pass=48,49,50,51
LibFunc>cretxt,DE_CustomCharacterList,result,str:%string_to_pass%

str:48 locks up because 48 is a number, so without the str the DLL tries to send a numeric value, which of course is the wrong type - this DLL function expects a string. When you pass the wrong thing to a DLL all kinds of nasty things can happen. So you use str: to say "I want this passed as a string".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Using LibFunc

Post by kpassaur » Wed Sep 17, 2008 10:32 am

Marcus it makes perfect sense the way you explained it; however it did not work. This is help file that comes with the dll - perhaps it will shead some clues as to why

DE_GetDLLVersion
Parameters: None
Return Value: Version number of the dll multiplied by one hundred, eg a value of 100 is equivalent to version 1.00.
Notes: This allows the support of multiple versions of a DLL so that functions that might only be available in a later version can then only be called if the returned version currently being used is one that supports those functions.



DE_ExtractOCRTextFromTIFF
Parameters: tiffFile - filepath to a TIFF image
textFile - filepath to the file that will contain the OCR text extracted from the TIFF image
pageBreakText - NULL or a string containing a more visual separator between page text - try using "\n********** PAGE BREAK **********\n\n"
textFilePerPage - must be one of the following values:

0 - No
1 - Yes - the page number will be automatically added to the text filename

Return Value: 0 - success
1 - tiffFile does not exist
2 - itiffFile was not in a recognised TIFF format
3 - no pages in the TIFF file

Notes: If a TIFF file has had it's image OCR'd using Microsoft Document Imaging then the OCR'd text is stored with the image inside the TIFF file
Using this API any such OCR'd text can be output to a file for external indexing/reference.
Use \n in the pageBreakText to force a newline to be output.



DE_CaseSensitivity
Parameters: type - must be one of the following values:

0 - None - characters are not checked
1 - Lower case - all upper case characters are converted to lower case
2 - Upper case - all lower case characters are converted to upper case

Return Value: 0 - success
1 - invalid option
Notes: Default is 0 (None)



DE_CharactersToExtract
Parameters: type - must be one of the following values:

0 - None - all characters are extracted
1 - Strict ASCII - all character codes between 0 and 127 are extracted, any characters from 128 to 255 are ignored
2 - Printable ASCII - character codes 10, 13, 32 (space) to 126 (~) are extracted, all other characters are ignored
3 - Custom - only the characters specified by DE_CustomCharacterList (see below) are extracted, all other characters are ignored

Return Value: 0 - success
1 - invalid option
Notes: Default is 0 (None)



DE_CustomCharacterList
Parameters: list - string containing numeric character codes to extract when the Custom option in DE_CharactersToExtract is selected.
Return Value: 0 - success
1 - invalid list
Notes: Specifies the numeric character codes to extract.
Use commas to separate character codes, eg 65,66,67.
Use hypen to specify a range, eg 32-126

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 17, 2008 10:52 am

Let me know what happens with:

Let>string_to_pass=48,49,50,51
LibFunc>cretxt,DE_CustomCharacterList,result,str:string_to_pass

Or:

LibFunc>cretxt,DE_CustomCharacterList,result,str:{"48,49,50,51"}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

LibFunc and Str:

Post by kpassaur » Wed Sep 17, 2008 11:01 am

Marcus

Got it

Let>string_to_pass=48,49,50,51
LibFunc>cretxt,DE_CustomCharacterList,result,str:string_to_pass

It seems you cannot have the "%" around it when it is passed. Don't let this go to your head, but you are great.

Thank you.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts