deleting value of the same in other field or menu buttons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

deleting value of the same in other field or menu buttons

Post by pidobearBUSsb9q » Fri Aug 03, 2012 7:23 am

Hey guys

i am trying to delete a value from a field/menu button that have the same value with the other field/menu button
which mean
the same value of the 2 field/ menu button would be gone if i delete anyone of them.

thanks


cheers
:D :D :D

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: deleting value of the same in other field or menu button

Post by shaosean » Fri Aug 03, 2012 7:45 am

- put the text of the field/menu into a variable
- put the lineOffset into a variable
- if the lineOffset variable is greater than 0; delete line (lineOffsetVariable) of (fieldMenuVariable)
- set the text of the field/menu to (fieldMenuVariable)

pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

Re: deleting value of the same in other field or menu button

Post by pidobearBUSsb9q » Fri Aug 03, 2012 7:58 am

shaosean wrote:- put the text of the field/menu into a variable
- put the lineOffset into a variable
- if the lineOffset variable is greater than 0; delete line (lineOffsetVariable) of (fieldMenuVariable)
- set the text of the field/menu to (fieldMenuVariable)
sorry but how to you set the lineOffset?

SyntaxlineOffset(lineToFind,stringToSearch[,linesToSkip])
what do they mean by lineToFind?

the other field?

Code: Select all

   put selectedText of field "dbDrop" into dropDb
   put lineOffset(dropDb,asd) into setline
   if the lineOffset variable is greater than 0; delete line (setline) of field "existDB"

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: deleting value of the same in other field or menu button

Post by jmburnod » Fri Aug 03, 2012 8:27 am

Hi pidobearBUSsb9q,

This script should work:

Code: Select all

   put selectedText of field "dbDrop" into dropDb
   put lineOffset(dropDb,asd) into setline
   if setline <> 0 then  delete line setline of field "existDB"
Best regards
Jean-Marc
https://alternatic.ch

pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

Re: deleting value of the same in other field or menu button

Post by pidobearBUSsb9q » Fri Aug 03, 2012 8:38 am

jmburnod wrote:Hi pidobearBUSsb9q,

This script should work:

Code: Select all

   put selectedText of field "dbDrop" into dropDb
   put lineOffset[b](dropDb,asd[/b]) into setline
   if setline <> 0 then  delete line setline of field "existDB"
Best regards
Jean-Marc
hi

thanks for your help
but i didnt know what to put in for the bold part so i just placed asd in it sorry can you help by explaining what should be inside?

pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

Re: deleting value of the same in other field or menu button

Post by pidobearBUSsb9q » Fri Aug 03, 2012 9:05 am

okay i understand already

Thanks guys!

cheers
:D :D

pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

Re: deleting value of the same in other field or menu button

Post by pidobearBUSsb9q » Fri Aug 03, 2012 9:14 am

How do i set the datagrid column names same as the database when i switch database to view?

can it be done?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: deleting value of the same in other field or menu button

Post by Klaus » Fri Aug 03, 2012 12:22 pm

pidobearBUSsb9q wrote:How do i set the datagrid column names same as the database when i switch database to view?
can it be done?
Yes, it can be done 8)

You can set the names of the columns and also the label of the columns:
...
## Rename the internal naming:
set the dgProp["columns"] of group "Data Grid" to your_CR_separated_list_of_new_column_names
...
## Only change the display of the column headers:
set the dgProp["column labels"] of group "Data Grid" to your_CR_separated_list_of_new_column_LABELS
...

I strongly recommend that you download the manual for the data grid and work through it!
Get the PDF here:
http://lessons.runrev.com/m/datagrid

And of course these great stacks:
http://www.runrev.com/developers/lesson ... nferences/

Best

Klaus

pidobearBUSsb9q
Posts: 34
Joined: Fri Jul 13, 2012 8:40 am

Re: deleting value of the same in other field or menu button

Post by pidobearBUSsb9q » Mon Aug 06, 2012 4:22 am

Klaus wrote:
pidobearBUSsb9q wrote:How do i set the datagrid column names same as the database when i switch database to view?
can it be done?
Yes, it can be done 8)

You can set the names of the columns and also the label of the columns:
...
## Rename the internal naming:
set the dgProp["columns"] of group "Data Grid" to your_CR_separated_list_of_new_column_names
...
## Only change the display of the column headers:
set the dgProp["column labels"] of group "Data Grid" to your_CR_separated_list_of_new_column_LABELS
...

I strongly recommend that you download the manual for the data grid and work through it!
Get the PDF here:
http://lessons.runrev.com/m/datagrid

And of course these great stacks:
http://www.runrev.com/developers/lesson ... nferences/

Best

Klaus
Hi
thanks for helping
where to i put this (your_CR_separated_list_of_new_column_names)?

thanks for the reference.
will go through that.

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: deleting value of the same in other field or menu button

Post by Klaus » Mon Aug 06, 2012 11:48 am

Hi pidobearBUSsb9q,
pidobearBUSsb9q wrote:...where to i put this (your_CR_separated_list_of_new_column_names)?
hmm, when neccessary :D
Maybe right before you display the data in your datagrid?

And please stop quoting the complete previous posting, that does not make any sense unless you answer
specail parts from the quoted posting directly, see above 8)

Best

Klaus

Post Reply