S
stephen2017
Guest
Hi all,
Little help needed please. What I am trying to do is load values from a ini file called Users. If the user1,user2 etc has a value I want to create a blank button with that string added to it and if no value exits as it goes through the loop then break out of the loop and stop creating buttons. Basically part of a log on screen for multiple users.
But at the moment its just creating buttons and not stopping when it finds "".
This is my ini file values.
[Name]
User1="John"
User2=""
User3=""
User4=""
User5=""
User6=""
User7=""
User8=""
Here is my code.
var User;
var ypos=40;
ini_open("Users.ini");
for(i=1; i<=8; i++){
User = ini_read_string("Name",string_insert(string(i), "User", 5),"")
if (User != ""){
instance_create(20,ypos,obj_Blankbutton);
ypos = ypos +50;
}
else{
break;
}
}
ini_close();
Little help needed please. What I am trying to do is load values from a ini file called Users. If the user1,user2 etc has a value I want to create a blank button with that string added to it and if no value exits as it goes through the loop then break out of the loop and stop creating buttons. Basically part of a log on screen for multiple users.
But at the moment its just creating buttons and not stopping when it finds "".
This is my ini file values.
[Name]
User1="John"
User2=""
User3=""
User4=""
User5=""
User6=""
User7=""
User8=""
Here is my code.
var User;
var ypos=40;
ini_open("Users.ini");
for(i=1; i<=8; i++){
User = ini_read_string("Name",string_insert(string(i), "User", 5),"")
if (User != ""){
instance_create(20,ypos,obj_Blankbutton);
ypos = ypos +50;
}
else{
break;
}
}
ini_close();