I want my program to make a button of the name of the file it loads but if I do filein = CreateButton() it will filein be the variable of the button
Newbuttons = ReadDir("C:\Program Files\BlitzPlus\games\Editor\buttons\regsize")
Repeat
file$ = NextFile$(Newbuttons)
If file$="" Then Goto main
a = a + 1
filein = ReadFile(file$)
Read1$ = ReadString(filein)
Read2 = ReadInt(filein)
Read3 = ReadInt(filein)
Read4$ = ReadString(filein)
If Read4$ = "jumponpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,jumponpanel)
If Read4$ = "invinciblepanel" Then * = CreateButton(Read1,Read2,Read3,100,500,invinciblepanel)
If Read4$ = "bosspanel" Then * = CreateButton(Read1,Read2,Read3,100,500,bosspanel)
If Read4$ = "headpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,headpanel)
If Read4$ = "jumppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,jumppanel)
If Read4$ = "backgroundpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,backgroungpanel)
If Read4$ = "tubespanel" Then * = CreateButton(Read1,Read2,Read3,100,500,tubespanel)
If Read4$ = "personpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,personpanel)
If Read4$ = "pickuppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,pickuppanel)
If Read4$ = "poweruppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,poweruppanel)
If Read4$ = "pointerspanel" Then * = CreateButton(Read1,Read2,Read3,100,500,pointerspanel)
CloseFile(filein)
; * = the variable that I want to make a button of
Forever
.main
CloseDir(Newbuttons)
Newbuttons = ReadDir("C:\Program Files\BlitzPlus\games\Editor\buttons\regsize")
Repeat
file$ = NextFile$(Newbuttons)
If file$="" Then Goto main
a = a + 1
filein = ReadFile(file$)
Read1$ = ReadString(filein)
Read2 = ReadInt(filein)
Read3 = ReadInt(filein)
Read4$ = ReadString(filein)
If Read4$ = "jumponpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,jumponpanel)
If Read4$ = "invinciblepanel" Then * = CreateButton(Read1,Read2,Read3,100,500,invinciblepanel)
If Read4$ = "bosspanel" Then * = CreateButton(Read1,Read2,Read3,100,500,bosspanel)
If Read4$ = "headpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,headpanel)
If Read4$ = "jumppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,jumppanel)
If Read4$ = "backgroundpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,backgroungpanel)
If Read4$ = "tubespanel" Then * = CreateButton(Read1,Read2,Read3,100,500,tubespanel)
If Read4$ = "personpanel" Then * = CreateButton(Read1,Read2,Read3,100,500,personpanel)
If Read4$ = "pickuppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,pickuppanel)
If Read4$ = "poweruppanel" Then * = CreateButton(Read1,Read2,Read3,100,500,poweruppanel)
If Read4$ = "pointerspanel" Then * = CreateButton(Read1,Read2,Read3,100,500,pointerspanel)
CloseFile(filein)
; * = the variable that I want to make a button of
Forever
.main
CloseDir(Newbuttons)