Y_Ini - Can I do it?!
#1

Hello, how I read a value from a simple file using Y_Ini? I tried this:

pawn Код:
new sLastVal;
new INI:sCELLUS = INI_Open("Stats.ini");
INI_Int("Cellus", sLastVal);
INI_Close(sCELLUS);
printf("Value: %d", sLastVal);
Does it work? Or... what is the correct way?
Reply
#2

I didn't understand the "[examples"] or "[more_examples"]... are they sessions or "classes" of a specific file? Can I use the code below, for example?

pawn Код:
new sValue;

main()
{
    INI_Load("Stats.ini");
}

INI:Stats[ServerStats](name[], value[])
{
    INI_Int("sCELLUS", sValue);
}

// Debug

printf("Value of var: %d", sValue);

EDIT: and if my file doesn't have "sessions"? If I did not create ... ?

Thank you very much
Reply
#3

Can anyone answer?
Reply
#4

Quote:

They are sections, they divide the file up so that you can have multilpe pieces of data associated with each other.

Yeah... I understand. But I'm referring to this:


INI:mine[examples](name[], value[])
{
}

If my file doesn't have "sections"? If I did not create... ? Example:

Код:
Test1 = 1
Test2 = 2
Test3 = 3
sCELLUS = 10
How would the code? Could you give me an example?

Thanks
Reply
#5

Ok, thank you ******
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)