PDA

View Full Version : XML saving to a file


Murdoch
03-16-2006, 07:13 AM
I have been asked to make a program that can be used in a shop (Barbers)
I only have 8 buttons ie Gents, flattop, and so on, I want to set a value to each button (a price) then when the user clicks it, it saves the price to a file say an xml file, but at the same time it adds to a list in the file of how many hair cuts have been done that day, say gents 10, flattop's 4 and so on. I don't have a project as such just 8 buttons no code so i can't upload anything what i would like is some advice on how i would start it so i start the project the right way (makes it easyer for me to understand what i am doing) i have the xml plugin but just never used it, should i make the whole thing in xml then load it to ams6 or should i start with a blank xml then save it. i have looked on the forum for this kind of thing but not been able to find some thing that would help me start off the user does not want to type anything in just click and record the days taken's.
Thank you

Murdoch
03-16-2006, 07:51 AM
i have use the amount variable to set the button and then display the amount as each button has its own non changable amount this was simple i need to connect to an xml doc now anyone tell me how i do this...

playmenow
03-16-2006, 11:15 AM
XML.Load("file")
&
XML.Save("file")

Murdoch
03-16-2006, 03:19 PM
XML.Load("file")
&
XML.Save("file")


Thx i understand the save and load i made the xml file, then on program start, it loads the page into memory, then i made the buttons sign a value to the button then when that button is pushed it saves the value amount to a cell, at the same time adding 1 to the count, but i can't get it to save the value amount to a cell on a xml doc because i don't know the best way of doing it i just trying things to see if it works
do i set up the xml doc first with the names or can i do it in the project iam lost

bobbie
03-16-2006, 04:01 PM
Did you have a look here?
http://www.indigorose.com/forums/showthread.php?t=13131
And look somemore in the example forum for more.

TJ_Tigger
03-16-2006, 08:06 PM
Thx i understand the save and load i made the xml file, then on program start, it loads the page into memory, then i made the buttons sign a value to the button then when that button is pushed it saves the value amount to a cell, at the same time adding 1 to the count, but i can't get it to save the value amount to a cell on a xml doc because i don't know the best way of doing it i just trying things to see if it works
do i set up the xml doc first with the names or can i do it in the project iam lost

What do you have or code currently. What I have done in the past is if I want to create a document I will have a string with the basic structure I want to create. like this

strXML = [[<quiz>
<Name></Name>
<Desc></Desc>
</quiz>]]


Then when I want to add something to this I will load the XML string (XML.SetXML) and then add items to it. XML.SetValue("quiz/items/question|1", "Ask your question here?");

I hope that helps.
tigg

Corey
03-16-2006, 08:19 PM
That's a solid tip from Tigger, I think that's a good approach. :yes

Murdoch
03-17-2006, 05:08 AM
Thank you for your help, but i am still lost and i am working on this very hard I still don't understand it yet but I will get there, I have a problem I don't understand when i create a xml file with ams it saves it to my c drive or ams doc's and its a blue icon file, when i make a xml file in excel it saves it as a green excel file the standard workbook, if i open the ams one in excel it say's " this file is not in a recognizable format".

xls and xml ? what have i done I just notised that there not the same format have i been trying to do things in one and not the other.

Its like i can't see the wood for the trees. and my head hurts.