Re: what is the problem with this bgt code

And you could also make it a bit more secure like this:

void notepad()
{
string ntitle=v.input("enter the title of your note.");
if (ntitle=="") {
mainmenu();
}
string ntext=v.input("enter the text of your note.");
if (ntext=="") {
mainmenu();
}
writetext(ntitle, ntext);
}

void writetext(string title, string text)
{
if (!directory_exists("notes")) {
directory_create("notes");
}
f.open("notes/"+title+".txt","w");
f.write(text);
f.close();
dlg("note created. Look in the notes folder.");
mainmenu();
}

Also, please don't code by putting executable branches for one-statement conditionals on the same line as the conditional. It makes your code that much harder to read. C programmers do this shit all the time and its irritating as hell.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bopitmaster34 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : patrickthepatshit via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : patrickthepatshit via Audiogames-reflector

Reply via email to