String-Handling in Dynamics NAV

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2007-11-05 in Download section
String-Handling in Dynamics NAV
Missing the READ/DATA Option form C64? (I'Ve owned a Spectrum 48!), or want to divide Memo-Fields or Colums into Navision Fields/Tablerow's? Need to compare Meyer with Mayer (i use this for un-double my Music Inventory)? Missing left,mid,right? Want to convert 123,55 to 000012355, or convert OdD wRiTTen Text to clear Readable Text? Convert between ASCII/ANSI? Some of this Functions are allready avaible, some are new in Navision. With Example's how it works and short descriptions in the Functions. The CU is self-containing, means no interaction with any other Financials-part. Just insert, test or remove the Function, no Sidekick-effect.

Object: Codeunit 50002

Functions:
DamerauLevenshtein
min
BuildPhonetic
ReplacePart
Part
Npart
Mid
Left
Right
InsertString
ReplaceString
FormatBool
FillingZero
Title
ConvertÄÖÜ Internet
Ascii<>Ansi
WordWrap
IsChar
IsNumber
ClearString

http://www.mibuso.com/dlinfo.asp?FileID=909

Discuss this download here.

Comments

  • ajhvdbajhvdb Member Posts: 672
    Thx for sharing,

    Just a question: The ascii to ansi function, which character set (code page) in windows regional settings do you use? I'm guessing this function will only work in some countries?...
  • rthswrthsw Member Posts: 73
    You are right, the Function is designed for the Codepage 850 With German as Base-Language of Navision (depending on the STX-Content). The Function is very easy to use and translate, you need only once to determine the Special Chars from ASCII (Ansi is allways the same) for both directions translations. Maybe you will also use a text-constant instead of some Codelines. Feel free to expand. I just wanted to show a very fast and short way to translate instead of hundred Codelines.
  • rthswrthsw Member Posts: 73
    DamerauLevenshtein - determines the Difference eg. between meyer & mayer = 1, Schulz & Thöne = 5
    min (resultes the smalest of 3 Values, used internal)
    BuildPhonetic (Converts string to Phonetic Spelling)
    ReplacePart (Search and replace a substring in a mainstring, set to local: better switch to public, is usefull)
    Part (give the Nth element of a list divided by a divider)
    Npart (same as part, but returns a decimal, if possbile (else 0)
    Mid (works like copystr, but easyer (as possible) to use)
    Left (give the left N chars of a string)
    Right (give the right N chars of a string)
    InsertString (inserts a Substring into Mainstring)
    ReplaceString (replace a part of the mainstring with the Substring)
    FormatBool (Choose the first or second String of a Comma-list, even if empty: reminds on the Navi 3.56 handling of BoolFormat)
    FillingZero (converts e.g. a 123,55 to 0000012355)
    Title (converts ODD WrittEN StRiNg to Odd Written String)
    ConvertÄÖÜ Internet (converts e.g. ä to &auml)
    Ascii<>Ansi (converts betwen german Codepage ASCII and Ansi and back)
    WordWrap (converts easily a long string into Table-compatible parts)
    IsChar (tests, if a single char is something like abcd (true) or more 123%$§ (false))
    IsNumber (same as IsChar, but results true on 0-9)
    ClearString (Removes forbidden chars out of Mainstring, you can chosse some standards (as only numbers, only chars, only Uppercase), and can spell the allowed chars)
Sign In or Register to comment.