ini-file

Discussion in 'Questions (Windows Mobile)' started by sloopa, May 4, 2007.

  1. sloopa

    sloopa Member Licensed User

    i am just to lazy... so don't stress your mind!
    (i will find a solution myself)

    but if a solution exists:

    has somebody a solution for a configuration-file like an ini-file?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It should be pretty easy.
    Code:
    [SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][SIZE=2]Globals[/SIZE]
     
    [SIZE=
    2][COLOR=#0000ff]End Sub[/COLOR][/SIZE]
    [SIZE=
    2][COLOR=#0000ff]Sub [/COLOR][/SIZE][SIZE=2]App_Start[/SIZE]
    [SIZE=
    2]Form1.Show[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]FileExist[/COLOR][/SIZE][SIZE=2]("myapp.ini") = true then [/SIZE]
    [SIZE=
    2][COLOR=#0000ff] FileOpen[/COLOR][/SIZE][SIZE=2](c1,"myapp.ini",cRead)[/SIZE]
    [SIZE=
    2] parameter1 = [/SIZE][SIZE=2][COLOR=#0000ff]FileRead[/COLOR][/SIZE][SIZE=2](c1)[/SIZE]
    [SIZE=
    2] parameter2 = [/SIZE][SIZE=2][COLOR=#0000ff]FileRead[/COLOR][/SIZE][SIZE=2](c2)[/SIZE]
    [SIZE=
    2][COLOR=#008000] '...[/COLOR][/SIZE]
    [SIZE=
    2][COLOR=#0000ff] FileClose[/COLOR][/SIZE][SIZE=2](c1)[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE]
    [SIZE=
    2][COLOR=#0000ff]End Sub[/COLOR][/SIZE]
     
    [SIZE=
    2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Form1_Close[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]FileOpen[/COLOR][/SIZE][SIZE=2](c1,"myapp.ini",cWrite)[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]FileWrite[/COLOR][/SIZE][SIZE=2](c1,parameter1)[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]FileWrite[/COLOR][/SIZE][SIZE=2](c1,parameter2)[/SIZE]
    [SIZE=
    2][COLOR=#008000]'...[/COLOR][/SIZE]
    [SIZE=
    2][COLOR=#0000ff]FileClose[/COLOR][/SIZE][SIZE=2](c1)[/SIZE]
    [SIZE=
    2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
     
  3. Cableguy

    Cableguy Expert Licensed User

    Hi,

    I adressed a similar issue in the old forum were when my app started it searched for a language config file and load it's contents...If usefull i'll re-write my code sample and post it...
     
  4. sloopa

    sloopa Member Licensed User

    Hi CableGuy

    you're welcome (to send the code :) )
     
  5. Cableguy

    Cableguy Expert Licensed User

    Here's my sample code for the above issue, hope it helps..
     

    Attached Files:

  6. taximania

    taximania Well-Known Member Licensed User

  7. RandomCoder

    RandomCoder Well-Known Member Licensed User

    This advice has also helped me, I'm wanting to create a high scores table for my Splat Master game which I showed in the old Forum. With a bit of luck I'll have this done in next to no time now and then I'll post my code again for you all to enjoy. It's bigger and better now :sign0098:

    Thanks,
    RandomCoder
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice