ConvertASCIIToANSI FOB example

Administrator
Member, Moderator, Administrator Posts: 2,506
ConvertASCIIToANSI FOB example
example how to convert ASCII to ANSI and back
http://www.mibuso.com/dlinfo.asp?FileID=1096
Discuss this download here.
example how to convert ASCII to ANSI and back
http://www.mibuso.com/dlinfo.asp?FileID=1096
Discuss this download here.
0
Comments
-
Is this the same as: http://mibuso.com/dlinfo.asp?FileID=287 ?0
-
Yes, I used that one too but had problems with import. Will check this one out. Thx.
Ps.
How can you add your own characters. Is there a howto?0 -
What is this, an old one, a new one - whether or not, there is a standard-nav-codeunit 11501, which does this job.0
-
That number belongs to a localization, so it's not part of every standard database. Could you tell us which localization you are working with?0
-
I am working with AT.0
-
Yes, the sample codeunit is merely a copy (with some empty additional functions) of the localized standard NAV 4.0 (SP1) Codeunit 11501 (VersionList=NAVDACH4.00.01).
There is another (earlier) version of this codeunit in NAV 4.0 (VersionList=NAVDACH4.00) which is much more transparent and easier to extend, since it uses integer codes instead of letter symbols:OBJECT Codeunit 11501 GeneralMgt { OBJECT-PROPERTIES { Date=23.09.04; Time=12:00:00; Version List=NAVDACH4.00; } PROPERTIES { OnRun=BEGIN END; } CODE { VAR Text001@1150000 : TextConst 'DEU=Der Ordnername muss auf einen Schr„gstrich enden, d. h. %1.;ENU=The folder name must end with a slash character, i.e. %1.'; PROCEDURE CheckFolderName@2(VAR _Input@1150000 : Text[250]) _Output@1150001 : Text[250]; BEGIN // Check for ending slash of folder name IF _Input = '' THEN EXIT; IF NOT (COPYSTR(_Input,STRLEN(_Input)) IN ['\','/']) THEN MESSAGE(Text001,'c:\data\'); END; PROCEDURE Ansi2Ascii@10(_String@1150001 : Text[250]) _Output@1150000 : Text[250]; VAR i@1150003 : Integer; Z@1150002 : Char; BEGIN // Converts from ANSI to ASCII FOR i := 1 TO STRLEN(_String) DO BEGIN Z := _String[i]; CASE Z OF // Convert special chars in ASCII 228: Z := 132; // „ ANSI=Alt0228, ASCII=Alt132 196: Z := 142; // Ž 226: Z := 131; // ƒ 224: Z := 133; // … 225: Z := 160; // 229: Z := 134; // † 197: Z := 143; // 230: Z := 145; // ‘ 198: Z := 146; // ’ 199: Z := 128; // € 231: Z := 135; // ‡ 233: Z := 130; // ‚ 234: Z := 136; // ˆ 235: Z := 137; // ‰ 232: Z := 138; // Š 201: Z := 144; // 239: Z := 139; // ‹ 238: Z := 140; // Œ 236: Z := 141; // 237: Z := 161; // ¡ 246: Z := 148; // ” 214: Z := 153; // ™ 244: Z := 147; // “ 242: Z := 149; // • 243: Z := 162; // ¢ 252: Z := 129; // 220: Z := 154; // š 251: Z := 150; // – 249: Z := 151; // — 250: Z := 163; // £ 241: Z := 164; // ¤ 165: Z := 209; // ¥ 255: Z := 152; // ˜ 163: Z := 156; // œ 248: Z := 157; // › END; _String[i] := Z; END; EXIT(_String); END; PROCEDURE Ascii2Ansi@1150001(_String@1150001 : Text[1024]) @1150000 : Text[1024]; VAR NoProcessed@1150002 : Integer; i@1150003 : Integer; Z@1150004 : Char; BEGIN // Converts from ASCII to ANSI FOR i := 1 TO STRLEN(_String) DO BEGIN Z := _String[i]; CASE Z OF // Convert special chars in ANSI 132: Z := 228; // „ ASCII=Alt132, ANSI = Alt0228 142: Z := 196; // Ž 131: Z := 226; // ƒ 133: Z := 224; // … 160: Z := 225; // 134: Z := 229; // † 143: Z := 197; // 145: Z := 230; // ‘ 146: Z := 198; // ’ 128: Z := 199; // € 135: Z := 231; // ‡ 130: Z := 233; // ‚ 136: Z := 234; // ˆ 137: Z := 235; // ‰ 138: Z := 232; // Š 144: Z := 201; // 139: Z := 239; // ‹ 140: Z := 238; // Œ 141: Z := 236; // 161: Z := 237; // ¡ 148: Z := 246; // ” 153: Z := 214; // ™ 147: Z := 244; // “ 149: Z := 242; // • 162: Z := 243; // ¢ 129: Z := 252; // 154: Z := 220; // š 150: Z := 251; // – 151: Z := 249; // — 163: Z := 250; // £ 164: Z := 241; // ¤ 165: Z := 209; // ¥ 152: Z := 255; // ˜ 156: Z := 163; // œ 157: Z := 248; // › END; _String[i] := Z; END; EXIT(_String); END; BEGIN END. } }
Note, that the letter signs (in the comments) are displayed correctly, if you import the object (may be with different object ID) into NAV.New kits on the blog: https://massivedynamicsblog.wordpress.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions