CoolBasic SDK

SetIniString

Include "cbAPI.cb"

KUVAUS
Tallettaa alfanumeerisen tiedon INI-tiedostoon.

Paluuarvo on True jos toiminto onnisti, muuten False.

KÄYTTÖ
SetIniString(iniFile$, sectionName$, keyName$, writeValue$)
iniFile - INI-tiedoston nimi.
Jos tiedoston nimi ei sisällä hakemistopolkua, järjestelmä etsii tiedostoa windows-hakemistosta.
Jos tiedostoa ei ole olemassa, se luodaan.

sectionName - Osion nimi. INI-tiedostossa osiot esitellään []-merkeillä kehystettynä. Esim [settings].

keyName - Osiossa olevan avaimen nimi.

writeValue - Arvo joka talletetaan.

Katso myös: GetIniStringSetIniIntGetIniInt

ESIMERKKI
windowTitle$ = GetIniString(CurrentDir() + "test.ini", "app", "windowtitle", "Test Application")
SetWindow windowTitle

Repeat
    // Vaihdetaan asetusta
    If KeyHit(cbKeyW) Then
        If InputBox("Uusi otsikko", "Asetus", windowTitle) = IDOK Then
            windowTitle$ = InputBoxText()
            SetIniString(CurrentDir() + "test.ini", "app", "windowtitle", windowTitle)
            SetWindow windowTitle
        EndIf
    EndIf
    DrawScreen
Forever