Windows System Programming
Windows System Programming
Das Kompendium liefert viele interessante Informationen zur Windows-Programmierung auf Englisch. [Mehr Infos...]
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!


Using mdTypes [EN]

von RedakteurMODSeite 7 von 12

- md/util/mdResourceBundle

mdResourceBundle is class you can use for many purposes. Mostly you will load config files or language files with it.
To create a bundle, use this line:

Dim As mdResourceBundle bundle = mdResourceBundle.getBundle("Important", "optional")

This line will create a new bundle and load the file "Important_optional.properties". If "optional" is empty, it will load "Important.properties". The first parameter can also contain a complete path.
Usually, you will use something like this:
- mdResourceBundle.getBundle("Language", "en") - to load Language_en.properties
- mdResourceBundle.getBundle("settings") - to load settings.properties

The format of the loaded file is "key=value". "key" is any String, but it is not allowed to contain a "=" sign. "value" is any String until end of line. The value can also contain parameters like "{0}" which are replaced with a given parameter with this index. Some examples:

Print bundle.containsKey("key") 'TRUE or FALSE
Print bundle.getString("key") 'Will print the value of this key
Print bundle.getString("key", "parameter") 'Will print the value with all appearances of {0} replaced by "parameter"
Print bundle.getString("key", array()) 'Will print the value with all parameters replaced with the value of the given index in the array
Print bundle.getString("key", "p0 p1 p2") 'Will print the value with all parameters replaced, which are seperated with space


Gehe zu Seite Gehe zu Seite  1  2  3  4  5  6  7  8  9  10  11  12  
Zusätzliche Informationen und Funktionen
  • Das Tutorial wurde am 17.04.2014 von RedakteurMOD angelegt.
  • Die aktuellste Version wurde am 05.09.2014 von RedakteurMOD gespeichert.
  Bearbeiten Bearbeiten  

  Versionen Versionen