View Full Version : Listbox Help
mrdude
06-12-2004, 04:07 AM
I am just learning how to use this great program just now and I was wanting to learn how to make data save in the list box, what I have made is a url saving type app, anyway - I have got a listbox and inside the listbox is urls, when you click on them you should jump to the webpage.
I have also got two input boxes, one is for the url and one is for a description.
What I want to be able to do is input text into this box and then it be saved into the listbox, I have got it saving to a text file just now - how can I get it to save into the listbox?
The attatchment is what i have done - this will explain it better.
Sorry for asking these stupid questions, but that is how I will learn - Thanks.
mrdude
06-12-2004, 10:21 AM
I am just learning how to use this great program just now and I was wanting to learn how to make data save in the list box, what I have made is a url saving type app, anyway - I have got a listbox and inside the listbox is urls, when you click on them you should jump to the webpage.
I have also got two input boxes, one is for the url and one is for a description.
What I want to be able to do is input text into this box and then it be saved into the listbox, I have got it saving to a text file just now - how can I get it to save into the listbox?
The attatchment is what i have done - this will explain it better.
Sorry for asking these stupid questions, but that is how I will learn - Thanks.
---Ok I best make myself clearer I know how to make the text and data go into the listbox and run- but when I start the app again, I want the previous data to still be there, Obviously the data needs to be saved to a file - and then reloaded again once the app starts, is there a command to do this?
itamar
06-12-2004, 06:53 PM
You won't be able to save the data the user adds in the list box, in Runtime.
Like you thought you should keep everything in text file, let the users append new address to the text file.
(After the appending you can add it to the list box to show the user his data received.)
Every time you lunch your program load the data from the file.
You can append the data in the text file in certain order like address#name.
When you read the file look for the divider # and you'll know what is the address and what is the name.
Itamar.
csd214
06-13-2004, 11:37 AM
Or you can add your data to an associative table. At exit (or when leaving the page) you write the table to a CSV (Comma Separated Values) text file. At next run the table is populated with the text lines.
In a previous post - Tables, CSV (Excel) and Reports (http://www.indigorose.com/forums/showthread.php?postid=32969#poststop) - I attached an example which could be named “XX Fan Club – Member archive”. Each record has a layout like this:
102,Jason Anderson,Winipeg,jason@dot.com,15 000,25
(RecID,Name,Address,Email,Amount)
Maybe this project can give you some ideas?
Extract from the code:
(Variable cList = "," in US, ";" in Europe)
tblDB[TblIdx] = {F1=Input.GetText("inpF1"), F2=Input.GetText("inpF2"), F3=Input.GetText("inpF3"), F4=Input.GetText("inpF4"), F5=Input.GetText("inpF5")};
recData = tblDB[item].F1..cList..tblDB[item].F2..cList..tblDB[item].F3..cList..tblDB[item].F4..cList..tblDB[item].F5..cList;
Table.Insert(tblText, 1, recData);
TextFile.WriteFromString(datafile, tblText[item] .. "\r\n", true); -- add record to file
mrdude
06-13-2004, 02:25 PM
Hey that's great! That's just the kind of thing I was looking for, man this forum rocks!.
Thanks very much guys, right i'm off to play now :D
Corey
06-13-2004, 02:36 PM
man this forum rocks!.
Hellllooooooo Cleveland! :yes
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.