List Field (boxes)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
List Field (boxes)
Hi, I'm new to RR and am used to Java 2. I am trying to figure out how to input data to a list box and then use it if it is highlighted. I have a simple add button that adds a name but it always replaces the current contents of the list field. Is there any documentation on the different objects? Do the objects have functions that I can access (oo oriented thinking I know but that's what I am used to). Any help would be great.
-
- Posts: 5
- Joined: Sat Jun 02, 2007 9:48 am
Hi jonnox,
actually you should do this, if you do not want an empty but selectable line in your listfield:
To get the content of the currently hilited line:
-> the selectedtext of fld "listfield"
To get the number of the currently hilited line:
-> the hilitedline of fld "listfield"
Hope that helps.
Best from germany
Klaus
P.S.
Please spread the word:
The best thing to do is to check all the stacks at:
http://downloads.runrev.com/section/scr ... rences.php
I wrote the one about controls in general
actually you should do this, if you do not want an empty but selectable line in your listfield:
Code: Select all
...
if fld "listfield" = empty then
put "New entry" into fld "listfield
else
put CR & "Another new entry" after fld "listfield"
end if
...
-> the selectedtext of fld "listfield"
To get the number of the currently hilited line:
-> the hilitedline of fld "listfield"
Hope that helps.
Best from germany
Klaus
P.S.
Please spread the word:
The best thing to do is to check all the stacks at:
http://downloads.runrev.com/section/scr ... rences.php
I wrote the one about controls in general

Sorry, I suppose that would have helped in the begning.
I have a list box (lstGrantor) and then an Add button and a Remove button. That code snipit is from remove. Below is from Add (which works now thank's to you
)
Basically I want them to Add names and then I am going to put them into variables to be used later. I just want them to be able to delete them if they make a mistake etc. Thanks again for all your help!
Jon
Code: Select all
on mouseUp
if the selectedline is empty then
-- do nothing
else
delete the selectedline
end if
end mouseUp

Code: Select all
ask "Enter name of Grantor" titled "Grantor"
if it is empty then
-- do nothing
else
if field lstGrantor is empty then
put it into field lstGrantor
else
put CR & it after field lstGrantor
end if
end if
Jon
Hi jonnox,
you're welcome!
Important hint:
It is always a good idea to put names in quotes!
This will prevent surprises if you can get used to it
AND it is a tad faster, since the engine will check first if there is variable with that name!
...
put it into field "lstGrantor"
...
Best from germany
Klaus
you're welcome!
Important hint:
It is always a good idea to put names in quotes!
This will prevent surprises if you can get used to it

AND it is a tad faster, since the engine will check first if there is variable with that name!
...
put it into field "lstGrantor"
...
Best from germany
Klaus