proc
new_recipe()
var/obj/recipe/N = new()
N.recname = input("What is the recipe's name?")
N.ingredients = input("What is in the recipe?")
for(N.ingredients)
N.ing="<li>[N.ingredients]"
N.yield = input("How much does this recipe yield?") as num
N.directions = input("What do you do?") as message
usr<< browse({"
<html>
<table>
<tr><td>
Name: [N.recname]
</tr></td>
<tr><td>
Ingredients: [N.ing]
</tr></td>
<tr><td>
Directions:<pre>[N.directions]</pre><dm>
</tr></td>
<tr><td>
Yield: [N.yield]
</tr></td>
</html>"})
RecList+=N.recname
world << RecList //check the RecList
mob
verb
new_rec()
new_recipe()
find_rec(t as text)
if(findtext(RecList,t))
world<< "Found"
else
world<< "0"
obj
recipe
var
recname as text
ingredients = list()
directions
yield as num
ing
var
RecList = list()
I have no errors show up, but I do have some problems.
1. The ingredients has a bullet, but it prints out as "The recipe" every time, no matter what.
2. RecList always comes up as "/list". I guess that the recname is adding?
3. Because RecList is "/list", the Find_rec always returns zero, because the recipe name isn't in the list it checks!
The following part is realated, but may not be for this forum, but I thought it should be because of the problems stated above.
This is a database application that I am attempting to create. As of now, I am trying to create a database of recipes. I have worked with savefiles very little, and while trying to figure out how to do the following, I got no where.
I want to be able to store all the variables of the recipe object, either in one savefile, seperated so I can get each recipe alone, or in many savefiles. That way, when the find_rec verb is processed, it gathers all the vars and creates a page just like the one seen when you create a recipe entry.