Buchempfehlung
MySQL kurz & gut
MySQL kurz & gut
Das preiswerte Taschen- buch stellt MySQL-rele- vante Inhalte systematisch und knapp dar, sodass es sich optimal zum Nach- schlagen beim Pro- grammieren eignet. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

Tutorial

Using mdTypes [EN]

von RedakteurMODSeite 7 von 12

Resources:
- 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 31.07.2019 von RedakteurMOD gespeichert.
  Bearbeiten Bearbeiten  

  Versionen Versionen