Constant array of UDT

New to FreeBASIC? Post your questions here.
Post Reply
Roland Chastain
Posts: 1003
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Constant array of UDT

Post by Roland Chastain »

Hello gentlemen!

I made a Pascal unit which looks like this:

Code: Select all

unit CodePageIdentifiers;

interface

type
  TIdentifier = record
    id,
    name,
    info: string;
  end;

const
  IDENTIFIERS: array[1..152] of TIdentifier = (
    (id: '037'; name: 'IBM037'; info: 'IBM EBCDIC US-Canada'),
    (id: '437'; name: 'IBM437'; info: 'OEM United States'),
    ...
I intend to make a FB version of that code, and I would be glad to know how you would declare and write it.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Constant array of UDT

Post by dkl »

Hi,

the closest translation currently is probably using a global array:

Code: Select all

type TIdentifier
	id as zstring * 4
	name as zstring * 7
	info as zstring * 32  '' TODO: check whether these string lengths are correct
end type

dim shared IDENTIFIERS(1 to 152) as const TIdentifier = { _
    ("037", "IBM037", "..."), _
    ("...", "...", "...") _
}
FB doesn't support array constants currently, so it's not quite the same... but chances are it will work just the same.

If it's for a library, then the global var should go into a .bas module, and should be exported via an extern IDENTIFIERS(1 to 152) as const TIdentifier in the .bi file.
Roland Chastain
Posts: 1003
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Constant array of UDT

Post by Roland Chastain »

Thank you for you answer, dkl. Your solution is fine. Here is the code:

Code: Select all

' https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=vs.85%29.aspx

#undef name

type TIdentifier
  id as integer
  name as zstring * 24
  info as zstring * 100
end type

dim shared IDENTIFIERS(1 to 152) as const TIdentifier = { _
  (037, "IBM037", "IBM EBCDIC US-Canada"), _
  (437, "IBM437", "OEM United States"), _
  (500, "IBM500", "IBM EBCDIC International"), _
  (708, "ASMO-708", "Arabic (ASMO 708)"), _
  (709, "", "Arabic (ASMO-449+, BCON V4)"), _
  (710, "", "Arabic - Transparent Arabic"), _
  (720, "DOS-720", "Arabic (Transparent ASMO); Arabic (DOS)"), _
  (737, "ibm737", "OEM Greek (formerly 437G); Greek (DOS)"), _
  (775, "ibm775", "OEM Baltic; Baltic (DOS)"), _
  (850, "ibm850", "OEM Multilingual Latin 1; Western European (DOS)"), _
  (852, "ibm852", "OEM Latin 2; Central European (DOS)"), _
  (855, "IBM855", "OEM Cyrillic (primarily Russian)"), _
  (857, "ibm857", "OEM Turkish; Turkish (DOS)"), _
  (858, "IBM00858", "OEM Multilingual Latin 1 + Euro symbol"), _
  (860, "IBM860", "OEM Portuguese; Portuguese (DOS)"), _
  (861, "ibm861", "OEM Icelandic; Icelandic (DOS)"), _
  (862, "DOS-862", "OEM Hebrew; Hebrew (DOS)"), _
  (863, "IBM863", "OEM French Canadian; French Canadian (DOS)"), _
  (864, "IBM864", "OEM Arabic; Arabic (864)"), _
  (865, "IBM865", "OEM Nordic; Nordic (DOS)"), _
  (866, "cp866", "OEM Russian; Cyrillic (DOS)"), _
  (869, "ibm869", "OEM Modern Greek; Greek, Modern (DOS)"), _
  (870, "IBM870", "IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2"), _
  (874, "windows-874", "ANSI/OEM Thai (ISO 8859-11); Thai (Windows)"), _
  (875, "cp875", "IBM EBCDIC Greek Modern"), _
  (932, "shift_jis", "ANSI/OEM Japanese; Japanese (Shift-JIS)"), _
  (936, "gb2312", "ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)"), _
  (949, "ks_c_5601-1987", "ANSI/OEM Korean (Unified Hangul Code)"), _
  (950, "big5", "ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)"), _
  (1026, "IBM1026", "IBM EBCDIC Turkish (Latin 5)"), _
  (1047, "IBM01047", "IBM EBCDIC Latin 1/Open System"), _
  (1140, "IBM01140", "IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)"), _
  (1141, "IBM01141", "IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)"), _
  (1142, "IBM01142", "IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)"), _
  (1143, "IBM01143", "IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)"), _
  (1144, "IBM01144", "IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)"), _
  (1145, "IBM01145", "IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)"), _
  (1146, "IBM01146", "IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)"), _
  (1147, "IBM01147", "IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)"), _
  (1148, "IBM01148", "IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)"), _
  (1149, "IBM01149", "IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)"), _
  (1200, "utf-16", "Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications"), _
  (1201, "unicodeFFFE", "Unicode UTF-16, big endian byte order; available only to managed applications"), _
  (1250, "windows-1250", "ANSI Central European; Central European (Windows)"), _
  (1251, "windows-1251", "ANSI Cyrillic; Cyrillic (Windows)"), _
  (1252, "windows-1252", "ANSI Latin 1; Western European (Windows)"), _
  (1253, "windows-1253", "ANSI Greek; Greek (Windows)"), _
  (1254, "windows-1254", "ANSI Turkish; Turkish (Windows)"), _
  (1255, "windows-1255", "ANSI Hebrew; Hebrew (Windows)"), _
  (1256, "windows-1256", "ANSI Arabic; Arabic (Windows)"), _
  (1257, "windows-1257", "ANSI Baltic; Baltic (Windows)"), _
  (1258, "windows-1258", "ANSI/OEM Vietnamese; Vietnamese (Windows)"), _
  (1361, "Johab", "Korean (Johab)"), _
  (10000, "macintosh", "MAC Roman; Western European (Mac)"), _
  (10001, "x-mac-japanese", "Japanese (Mac)"), _
  (10002, "x-mac-chinesetrad", "MAC Traditional Chinese (Big5); Chinese Traditional (Mac)"), _
  (10003, "x-mac-korean", "Korean (Mac)"), _
  (10004, "x-mac-arabic", "Arabic (Mac)"), _
  (10005, "x-mac-hebrew", "Hebrew (Mac)"), _
  (10006, "x-mac-greek", "Greek (Mac)"), _
  (10007, "x-mac-cyrillic", "Cyrillic (Mac)"), _
  (10008, "x-mac-chinesesimp", "MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)"), _
  (10010, "x-mac-romanian", "Romanian (Mac)"), _
  (10017, "x-mac-ukrainian", "Ukrainian (Mac)"), _
  (10021, "x-mac-thai", "Thai (Mac)"), _
  (10029, "x-mac-ce", "MAC Latin 2; Central European (Mac)"), _
  (10079, "x-mac-icelandic", "Icelandic (Mac)"), _
  (10081, "x-mac-turkish", "Turkish (Mac)"), _
  (10082, "x-mac-croatian", "Croatian (Mac)"), _
  (12000, "utf-32", "Unicode UTF-32, little endian byte order; available only to managed applications"), _
  (12001, "utf-32BE", "Unicode UTF-32, big endian byte order; available only to managed applications"), _
  (20000, "x-Chinese_CNS", "CNS Taiwan; Chinese Traditional (CNS)"), _
  (20001, "x-cp20001", "TCA Taiwan"), _
  (20002, "x_Chinese-Eten", "Eten Taiwan; Chinese Traditional (Eten)"), _
  (20003, "x-cp20003", "IBM5550 Taiwan"), _
  (20004, "x-cp20004", "TeleText Taiwan"), _
  (20005, "x-cp20005", "Wang Taiwan"), _
  (20105, "x-IA5", "IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)"), _
  (20106, "x-IA5-German", "IA5 German (7-bit)"), _
  (20107, "x-IA5-Swedish", "IA5 Swedish (7-bit)"), _
  (20108, "x-IA5-Norwegian", "IA5 Norwegian (7-bit)"), _
  (20127, "us-ascii", "US-ASCII (7-bit)"), _
  (20261, "x-cp20261", "T.61"), _
  (20269, "x-cp20269", "ISO 6937 Non-Spacing Accent"), _
  (20273, "IBM273", "IBM EBCDIC Germany"), _
  (20277, "IBM277", "IBM EBCDIC Denmark-Norway"), _
  (20278, "IBM278", "IBM EBCDIC Finland-Sweden"), _
  (20280, "IBM280", "IBM EBCDIC Italy"), _
  (20284, "IBM284", "IBM EBCDIC Latin America-Spain"), _
  (20285, "IBM285", "IBM EBCDIC United Kingdom"), _
  (20290, "IBM290", "IBM EBCDIC Japanese Katakana Extended"), _
  (20297, "IBM297", "IBM EBCDIC France"), _
  (20420, "IBM420", "IBM EBCDIC Arabic"), _
  (20423, "IBM423", "IBM EBCDIC Greek"), _
  (20424, "IBM424", "IBM EBCDIC Hebrew"), _
  (20833, "x-EBCDIC-KoreanExtended", "IBM EBCDIC Korean Extended"), _
  (20838, "IBM-Thai", "IBM EBCDIC Thai"), _
  (20866, "koi8-r", "Russian (KOI8-R); Cyrillic (KOI8-R)"), _
  (20871, "IBM871", "IBM EBCDIC Icelandic"), _
  (20880, "IBM880", "IBM EBCDIC Cyrillic Russian"), _
  (20905, "IBM905", "IBM EBCDIC Turkish"), _
  (20924, "IBM00924", "IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)"), _
  (20932, "EUC-JP", "Japanese (JIS 0208-1990 and 0212-1990)"), _
  (20936, "x-cp20936", "Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)"), _
  (20949, "x-cp20949", "Korean Wansung"), _
  (21025, "cp1025", "IBM EBCDIC Cyrillic Serbian-Bulgarian"), _
  (21027, "", "(deprecated)"), _
  (21866, "koi8-u", "Ukrainian (KOI8-U); Cyrillic (KOI8-U)"), _
  (28591, "iso-8859-1", "ISO 8859-1 Latin 1; Western European (ISO)"), _
  (28592, "iso-8859-2", "ISO 8859-2 Central European; Central European (ISO)"), _
  (28593, "iso-8859-3", "ISO 8859-3 Latin 3"), _
  (28594, "iso-8859-4", "ISO 8859-4 Baltic"), _
  (28595, "iso-8859-5", "ISO 8859-5 Cyrillic"), _
  (28596, "iso-8859-6", "ISO 8859-6 Arabic"), _
  (28597, "iso-8859-7", "ISO 8859-7 Greek"), _
  (28598, "iso-8859-8", "ISO 8859-8 Hebrew; Hebrew (ISO-Visual)"), _
  (28599, "iso-8859-9", "ISO 8859-9 Turkish"), _
  (28603, "iso-8859-13", "ISO 8859-13 Estonian"), _
  (28605, "iso-8859-15", "ISO 8859-15 Latin 9"), _
  (29001, "x-Europa", "Europa 3"), _
  (38598, "iso-8859-8-i", "ISO 8859-8 Hebrew; Hebrew (ISO-Logical)"), _
  (50220, "iso-2022-jp", "ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)"), _
  (50221, "csISO2022JP", "ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)"), _
  (50222, "iso-2022-jp", "ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)"), _
  (50225, "iso-2022-kr", "ISO 2022 Korean"), _
  (50227, "x-cp50227", "ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)"), _
  (50229, "", "ISO 2022 Traditional Chinese"), _
  (50930, "", "EBCDIC Japanese (Katakana) Extended"), _
  (50931, "", "EBCDIC US-Canada and Japanese"), _
  (50933, "", "EBCDIC Korean Extended and Korean"), _
  (50935, "", "EBCDIC Simplified Chinese Extended and Simplified Chinese"), _
  (50936, "", "EBCDIC Simplified Chinese"), _
  (50937, "", "EBCDIC US-Canada and Traditional Chinese"), _
  (50939, "", "EBCDIC Japanese (Latin) Extended and Japanese"), _
  (51932, "euc-jp", "EUC Japanese"), _
  (51936, "EUC-CN", "EUC Simplified Chinese; Chinese Simplified (EUC)"), _
  (51949, "euc-kr", "EUC Korean"), _
  (51950, "", "EUC Traditional Chinese"), _
  (52936, "hz-gb-2312", "HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)"), _
  (54936, "GB18030", "Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)"), _
  (57002, "x-iscii-de", "ISCII Devanagari"), _
  (57003, "x-iscii-be", "ISCII Bengali"), _
  (57004, "x-iscii-ta", "ISCII Tamil"), _
  (57005, "x-iscii-te", "ISCII Telugu"), _
  (57006, "x-iscii-as", "ISCII Assamese"), _
  (57007, "x-iscii-or", "ISCII Oriya"), _
  (57008, "x-iscii-ka", "ISCII Kannada"), _
  (57009, "x-iscii-ma", "ISCII Malayalam"), _
  (57010, "x-iscii-gu", "ISCII Gujarati"), _
  (57011, "x-iscii-pa", "ISCII Punjabi"), _
  (65000, "utf-7", "Unicode (UTF-7)"), _
  (65001, "utf-8", "Unicode (UTF-8)") _
}

Code: Select all

#include "codepageidentifiers.bas"

with IDENTIFIERS(1)
  print(.id)
  print(.name)
  print(.info)
end with
Now I will try your hint about a library.
Last edited by Roland Chastain on May 04, 2015 19:17, edited 1 time in total.
Roland Chastain
Posts: 1003
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Constant array of UDT

Post by Roland Chastain »

dkl wrote:If it's for a library, then the global var should go into a .bas module, and should be exported via an extern IDENTIFIERS(1 to 152) as const TIdentifier in the .bi file.
I don't manage to do what you say. I tried several things, but not the good one. :)
Roland Chastain
Posts: 1003
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Constant array of UDT

Post by Roland Chastain »

Updated the code in my previous message (changed the type of the first field to integer).

@dkl

I would like to know exactly what you had in mind when you spoke of a library. Did you mean a static or a dynamic library? Anyway, I didn't manage to make any working code with your suggestion.
Last edited by Roland Chastain on May 05, 2015 4:12, edited 1 time in total.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Constant array of UDT

Post by dkl »

Hmm, well, the main point is that Dim Shared makes a global variable, not just a compile-time constant as (I presume) the Pascal code did.

It means that all .bas modules that include this global variable will get a copy of it. No problem if your program is just one .bas file, but it matters if you have multiple .bas modules.

In other words, one shouldn't put global variables in files that will be #included by others, because the global variables will be unnecessarily duplicated.

.bi files are commonly used by libraries, for exposing their API to programs that #include them. I thought that perhaps you're making a .bi file to access a Pascal library.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Constant array of UDT

Post by marcov »

dkl wrote:Hmm, well, the main point is that Dim Shared makes a global variable, not just a compile-time constant as (I presume) the Pascal code did.
Const is only compile-time if registerable, with a few exceptions (almost registerable like int64 on 32-bits systems) and declared with the const name=expression form, and not the name:type=expression form.

Otherwise it is an initialized variable that the compiler disallows to change directly (but that can be lifted using a pragma $J or $Writeableconst).

The section (interface or implementation) decides if it is exported from the module or not. If not exported it could be subject to optimization, but FPC (and all but a few older embedded Wirthian compilers) don't.
Roland Chastain
Posts: 1003
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Constant array of UDT

Post by Roland Chastain »

@dkl, marcov

Thank you for your answers.

For now, I have no particular purpose with that code: it's just the matter of an exercise. But if I can make something useful, of course I would be glad.

Would it be really useful to export the table as it is? Wouldn't it be better to have a function that would return the name of a given code page, and export the function?

Code: Select all

#include "CodePageIdentifiers.bas"

declare function GetCodePageName(byval id as integer) as string

print(GetCodePageName(37))
sleep

function GetCodePageName(byval id as integer) as string
  dim i as integer = LBound(IDENTIFIERS)
  do while (IDENTIFIERS(i).id <> id) and (i <= UBound(IDENTIFIERS))
    i += 1
  loop
  if i <= UBound(IDENTIFIERS) then
    function = IDENTIFIERS(i).name
  else
    function = ""
  end if
end function
The idea of making a library in Pascal and use it in FB code is also interesting. I should be able to do that, since dkl already helped me to solve a similar problem.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: Constant array of UDT

Post by Munair »

Your code will work with EXTERN if you do it like this:

TEST.BAS

Code: Select all

' test.bas

#include "test2.bas"

sub tests()
	print IDENTIFIERS(1).id
end sub

tests()
end
TEST2.BAS

Code: Select all

' test extern

#undef name

type TIdentifier
  id as integer
  name as zstring * 24
  info as zstring * 100
end type

extern IDENTIFIERS(1 to 152) as const TIdentifier

dim IDENTIFIERS(1 to 152) as const TIdentifier = { _
  (037, "IBM037", "IBM EBCDIC US-Canada"), _
  (437, "IBM437", "OEM United States"), _
  (500, "IBM500", "IBM EBCDIC International"), _
  (708, "ASMO-708", "Arabic (ASMO 708)"), _
  (709, "", "Arabic (ASMO-449+, BCON V4)"), _
  (710, "", "Arabic - Transparent Arabic"), _
  (720, "DOS-720", "Arabic (Transparent ASMO); Arabic (DOS)"), _
  (737, "ibm737", "OEM Greek (formerly 437G); Greek (DOS)"), _
  (775, "ibm775", "OEM Baltic; Baltic (DOS)"), _
  (850, "ibm850", "OEM Multilingual Latin 1; Western European (DOS)"), _
  (852, "ibm852", "OEM Latin 2; Central European (DOS)"), _
  (855, "IBM855", "OEM Cyrillic (primarily Russian)"), _
  (857, "ibm857", "OEM Turkish; Turkish (DOS)"), _
  (858, "IBM00858", "OEM Multilingual Latin 1 + Euro symbol"), _
  (860, "IBM860", "OEM Portuguese; Portuguese (DOS)"), _
  (861, "ibm861", "OEM Icelandic; Icelandic (DOS)"), _
  (862, "DOS-862", "OEM Hebrew; Hebrew (DOS)"), _
  (863, "IBM863", "OEM French Canadian; French Canadian (DOS)"), _
  (864, "IBM864", "OEM Arabic; Arabic (864)"), _
  (865, "IBM865", "OEM Nordic; Nordic (DOS)"), _
  (866, "cp866", "OEM Russian; Cyrillic (DOS)"), _
  (869, "ibm869", "OEM Modern Greek; Greek, Modern (DOS)"), _
  (870, "IBM870", "IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2"), _
  (874, "windows-874", "ANSI/OEM Thai (ISO 8859-11); Thai (Windows)"), _
  (875, "cp875", "IBM EBCDIC Greek Modern"), _
  (932, "shift_jis", "ANSI/OEM Japanese; Japanese (Shift-JIS)"), _
  (936, "gb2312", "ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)"), _
  (949, "ks_c_5601-1987", "ANSI/OEM Korean (Unified Hangul Code)"), _
  (950, "big5", "ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)"), _
  (1026, "IBM1026", "IBM EBCDIC Turkish (Latin 5)"), _
  (1047, "IBM01047", "IBM EBCDIC Latin 1/Open System"), _
  (1140, "IBM01140", "IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)"), _
  (1141, "IBM01141", "IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)"), _
  (1142, "IBM01142", "IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)"), _
  (1143, "IBM01143", "IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)"), _
  (1144, "IBM01144", "IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)"), _
  (1145, "IBM01145", "IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)"), _
  (1146, "IBM01146", "IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)"), _
  (1147, "IBM01147", "IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)"), _
  (1148, "IBM01148", "IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)"), _
  (1149, "IBM01149", "IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)"), _
  (1200, "utf-16", "Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications"), _
  (1201, "unicodeFFFE", "Unicode UTF-16, big endian byte order; available only to managed applications"), _
  (1250, "windows-1250", "ANSI Central European; Central European (Windows)"), _
  (1251, "windows-1251", "ANSI Cyrillic; Cyrillic (Windows)"), _
  (1252, "windows-1252", "ANSI Latin 1; Western European (Windows)"), _
  (1253, "windows-1253", "ANSI Greek; Greek (Windows)"), _
  (1254, "windows-1254", "ANSI Turkish; Turkish (Windows)"), _
  (1255, "windows-1255", "ANSI Hebrew; Hebrew (Windows)"), _
  (1256, "windows-1256", "ANSI Arabic; Arabic (Windows)"), _
  (1257, "windows-1257", "ANSI Baltic; Baltic (Windows)"), _
  (1258, "windows-1258", "ANSI/OEM Vietnamese; Vietnamese (Windows)"), _
  (1361, "Johab", "Korean (Johab)"), _
  (10000, "macintosh", "MAC Roman; Western European (Mac)"), _
  (10001, "x-mac-japanese", "Japanese (Mac)"), _
  (10002, "x-mac-chinesetrad", "MAC Traditional Chinese (Big5); Chinese Traditional (Mac)"), _
  (10003, "x-mac-korean", "Korean (Mac)"), _
  (10004, "x-mac-arabic", "Arabic (Mac)"), _
  (10005, "x-mac-hebrew", "Hebrew (Mac)"), _
  (10006, "x-mac-greek", "Greek (Mac)"), _
  (10007, "x-mac-cyrillic", "Cyrillic (Mac)"), _
  (10008, "x-mac-chinesesimp", "MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)"), _
  (10010, "x-mac-romanian", "Romanian (Mac)"), _
  (10017, "x-mac-ukrainian", "Ukrainian (Mac)"), _
  (10021, "x-mac-thai", "Thai (Mac)"), _
  (10029, "x-mac-ce", "MAC Latin 2; Central European (Mac)"), _
  (10079, "x-mac-icelandic", "Icelandic (Mac)"), _
  (10081, "x-mac-turkish", "Turkish (Mac)"), _
  (10082, "x-mac-croatian", "Croatian (Mac)"), _
  (12000, "utf-32", "Unicode UTF-32, little endian byte order; available only to managed applications"), _
  (12001, "utf-32BE", "Unicode UTF-32, big endian byte order; available only to managed applications"), _
  (20000, "x-Chinese_CNS", "CNS Taiwan; Chinese Traditional (CNS)"), _
  (20001, "x-cp20001", "TCA Taiwan"), _
  (20002, "x_Chinese-Eten", "Eten Taiwan; Chinese Traditional (Eten)"), _
  (20003, "x-cp20003", "IBM5550 Taiwan"), _
  (20004, "x-cp20004", "TeleText Taiwan"), _
  (20005, "x-cp20005", "Wang Taiwan"), _
  (20105, "x-IA5", "IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)"), _
  (20106, "x-IA5-German", "IA5 German (7-bit)"), _
  (20107, "x-IA5-Swedish", "IA5 Swedish (7-bit)"), _
  (20108, "x-IA5-Norwegian", "IA5 Norwegian (7-bit)"), _
  (20127, "us-ascii", "US-ASCII (7-bit)"), _
  (20261, "x-cp20261", "T.61"), _
  (20269, "x-cp20269", "ISO 6937 Non-Spacing Accent"), _
  (20273, "IBM273", "IBM EBCDIC Germany"), _
  (20277, "IBM277", "IBM EBCDIC Denmark-Norway"), _
  (20278, "IBM278", "IBM EBCDIC Finland-Sweden"), _
  (20280, "IBM280", "IBM EBCDIC Italy"), _
  (20284, "IBM284", "IBM EBCDIC Latin America-Spain"), _
  (20285, "IBM285", "IBM EBCDIC United Kingdom"), _
  (20290, "IBM290", "IBM EBCDIC Japanese Katakana Extended"), _
  (20297, "IBM297", "IBM EBCDIC France"), _
  (20420, "IBM420", "IBM EBCDIC Arabic"), _
  (20423, "IBM423", "IBM EBCDIC Greek"), _
  (20424, "IBM424", "IBM EBCDIC Hebrew"), _
  (20833, "x-EBCDIC-KoreanExtended", "IBM EBCDIC Korean Extended"), _
  (20838, "IBM-Thai", "IBM EBCDIC Thai"), _
  (20866, "koi8-r", "Russian (KOI8-R); Cyrillic (KOI8-R)"), _
  (20871, "IBM871", "IBM EBCDIC Icelandic"), _
  (20880, "IBM880", "IBM EBCDIC Cyrillic Russian"), _
  (20905, "IBM905", "IBM EBCDIC Turkish"), _
  (20924, "IBM00924", "IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)"), _
  (20932, "EUC-JP", "Japanese (JIS 0208-1990 and 0212-1990)"), _
  (20936, "x-cp20936", "Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)"), _
  (20949, "x-cp20949", "Korean Wansung"), _
  (21025, "cp1025", "IBM EBCDIC Cyrillic Serbian-Bulgarian"), _
  (21027, "", "(deprecated)"), _
  (21866, "koi8-u", "Ukrainian (KOI8-U); Cyrillic (KOI8-U)"), _
  (28591, "iso-8859-1", "ISO 8859-1 Latin 1; Western European (ISO)"), _
  (28592, "iso-8859-2", "ISO 8859-2 Central European; Central European (ISO)"), _
  (28593, "iso-8859-3", "ISO 8859-3 Latin 3"), _
  (28594, "iso-8859-4", "ISO 8859-4 Baltic"), _
  (28595, "iso-8859-5", "ISO 8859-5 Cyrillic"), _
  (28596, "iso-8859-6", "ISO 8859-6 Arabic"), _
  (28597, "iso-8859-7", "ISO 8859-7 Greek"), _
  (28598, "iso-8859-8", "ISO 8859-8 Hebrew; Hebrew (ISO-Visual)"), _
  (28599, "iso-8859-9", "ISO 8859-9 Turkish"), _
  (28603, "iso-8859-13", "ISO 8859-13 Estonian"), _
  (28605, "iso-8859-15", "ISO 8859-15 Latin 9"), _
  (29001, "x-Europa", "Europa 3"), _
  (38598, "iso-8859-8-i", "ISO 8859-8 Hebrew; Hebrew (ISO-Logical)"), _
  (50220, "iso-2022-jp", "ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)"), _
  (50221, "csISO2022JP", "ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)"), _
  (50222, "iso-2022-jp", "ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)"), _
  (50225, "iso-2022-kr", "ISO 2022 Korean"), _
  (50227, "x-cp50227", "ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)"), _
  (50229, "", "ISO 2022 Traditional Chinese"), _
  (50930, "", "EBCDIC Japanese (Katakana) Extended"), _
  (50931, "", "EBCDIC US-Canada and Japanese"), _
  (50933, "", "EBCDIC Korean Extended and Korean"), _
  (50935, "", "EBCDIC Simplified Chinese Extended and Simplified Chinese"), _
  (50936, "", "EBCDIC Simplified Chinese"), _
  (50937, "", "EBCDIC US-Canada and Traditional Chinese"), _
  (50939, "", "EBCDIC Japanese (Latin) Extended and Japanese"), _
  (51932, "euc-jp", "EUC Japanese"), _
  (51936, "EUC-CN", "EUC Simplified Chinese; Chinese Simplified (EUC)"), _
  (51949, "euc-kr", "EUC Korean"), _
  (51950, "", "EUC Traditional Chinese"), _
  (52936, "hz-gb-2312", "HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)"), _
  (54936, "GB18030", "Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)"), _
  (57002, "x-iscii-de", "ISCII Devanagari"), _
  (57003, "x-iscii-be", "ISCII Bengali"), _
  (57004, "x-iscii-ta", "ISCII Tamil"), _
  (57005, "x-iscii-te", "ISCII Telugu"), _
  (57006, "x-iscii-as", "ISCII Assamese"), _
  (57007, "x-iscii-or", "ISCII Oriya"), _
  (57008, "x-iscii-ka", "ISCII Kannada"), _
  (57009, "x-iscii-ma", "ISCII Malayalam"), _
  (57010, "x-iscii-gu", "ISCII Gujarati"), _
  (57011, "x-iscii-pa", "ISCII Punjabi"), _
  (65000, "utf-7", "Unicode (UTF-7)"), _
  (65001, "utf-8", "Unicode (UTF-8)") _
}
Not sure if this is what dkl had in mind, but it compiles with FBC 1.05. Comment out the EXTERN statement and recompile to note the difference.
Post Reply