Page 1 of 1

move through lines of two fields

Posted: Sat Aug 30, 2014 3:34 pm
by francof
Hi all, another strange question.

I've 2 list field filled with data (fldA, fldB)
after clicking on a line of fldA I must move to the previous, next line of it with 2 different buttons (btnDwn, btnUp) and hilite the new line.
the same with fldB.
Hendlers of the buttons should be the same for the 2 fields.

how can I tell to the buttons on which field I've clicked before?
can I store the name of the field selected to use in the buttons hndlers?

ciao
franco

Re: move through lines of two fields

Posted: Sat Aug 30, 2014 4:02 pm
by jmburnod
Hi Franco,
how can I tell to the buttons on which field I've clicked before?
can I store the name of the field selected to use in the buttons hndlers?
You can use a customprop

Code: Select all

set the uMyWorkField of this cd to the short name of the target
or variable

Code: Select all

put the short name of the target into gMyWorkField
And use it to know which field is working
Best regards
Jean-Marc

Re: move through lines of two fields

Posted: Sat Aug 30, 2014 5:36 pm
by francof
Hi Jean-Marc,
thanks a lot. just one thing, you wrote to set the custom property of this cd (card), maybe you meant of fld "myfld" ?
so it work

Code: Select all

set the cNomeFld of fld "fldDoc" to the short name of the target
and something like this in the btnDwn script to move down through le lines

Code: Select all

on mouseUp
   put the cNomeFld of fld "fldDoc" into tNomeFld
   
   put the hilitedline of fld tNomeFld into tLineNumber                 ## What line has been clicked:
   add 1 to tLineNumber
  set the hilitedline of fld tNomeFld to tLineNumber
end mouseUp
there is a problem here:
"put the cNomeFld of fld "fldDoc" into tNomeFld" I must declare the name of the object. so, we return to the initial problem, some time the filed will be "fldA" other will be "fldB"

maybe better a global variable like in your second option, to put empty before to use.

ciao
franco

Re: move through lines of two fields

Posted: Sat Aug 30, 2014 5:57 pm
by jmburnod
Hi Franco,
you wrote to set the custom property of this cd (card), maybe you meant of fld "myf
No.That can't work like
then
When a line is cliqued on a fld

Code: Select all

set the cNomeFld of this cd to the short name of the target
and in btn

Code: Select all

on mouseUp
   put the cNomeFld of this cd into tNomeFld
   put the hilitedlines of fld tNomeFld into tLineNumber                 ## What line has been clicked:
   add 1 to tLineNumber
  set the hilitedline of fld tNomeFld to tLineNumber
end mouseUp
Best regards
P.S. You have maybe to decide if you can have two flds with selected lines or not

Re: move through lines of two fields

Posted: Sat Aug 30, 2014 6:37 pm
by francof
Jean-Marc,
I'm late.. and yuk :oops:
I was in the shower when, like lightning in my head, I understood your suggestion.
the custom property of the card, is available to set and is unique from any script, it works great.
jmburnod wrote: ...
P.S. You have maybe to decide if you can have two flds with selected lines or not
this was settled yet. in the mouse up of each filed:

Code: Select all

set the hilitedline of fld fldDoc to 0
thanks again, ciao
franco