cardsize,find,field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
cardsize,find,field
3 questions:
1. is it possible to change the size of 1 card without resizing the whole stack.
2. with find I see a rectangle around the chosen word. How when there are more identical words and I want them all. No such as "find again"?
With the that word I want to do someting with it, f.i. asking position, linenumber, position of first and last char; How?
3. In a scrolling list field I want by pressing a key, the first line beginning with that char scrolls up. Possible?
1. is it possible to change the size of 1 card without resizing the whole stack.
2. with find I see a rectangle around the chosen word. How when there are more identical words and I want them all. No such as "find again"?
With the that word I want to do someting with it, f.i. asking position, linenumber, position of first and last char; How?
3. In a scrolling list field I want by pressing a key, the first line beginning with that char scrolls up. Possible?
Re: cardsize,find,field
Hi Rob
-- script cd
Best regards
Jean-Marc
As far I know NO1. is it possible to change the size of 1 card without resizing the whole stack.
Yes. There is many ways to do that. I' cooking one and I'm coming back2. with find I see a rectangle around the chosen word. How when there are more identical words and I want them all. No such as "find again"?
With the that word I want to do someting with it, f.i. asking position, linenumber, position of first and last char; How?
Yes. Here is one way to do it.3. In a scrolling list field I want by pressing a key, the first line beginning with that char scrolls up. Possible?
-- script cd
Code: Select all
on keyup pKey
put allFirstLetters(myField) into tallFirstLetters
put pKey & "," into tSearch
put lineoffset(tSearch,tallFirstLetters) into tNumLine
get fDeNumToScroll(myField,tNumLine)
set the hilitedlines of fld "myField" to item 2 of line tNumLine of tallFirstLetters
set the scroll of fld "myField" to fDeNumToScroll(myField,tNumLine)
end keyup
--•• return a list of each first letter with the number of the foundline
function allFirstLetters pNameField
put empty into rallFirstLetters
put fld pNameField into tContentFld
put 0 into tCount
repeat for each line tLine in tContentFld
add 1 to tCount
if char 1 of tLine is in rallFirstLetters then next repeat
put char 1 of tLine & "," & tCount & cr after rallFirstLetters
end repeat
delete char -1 of rallFirstLetters
return rallFirstLetters
end allFirstLetters
--•• return the destination scrollV of the fld
function fDeNumToScroll pNameField,pNum
put the effective textHeight of fld pNameField into tSec
put (pNum-1)* tSec into tScroll
return tScroll
end fDeNumToScroll
Jean-Marc
https://alternatic.ch
Re: cardsize,find,field
Hello Jean-Marc
Rather complicated, but I'll study on it.
Thanks a lot
Rob
Rather complicated, but I'll study on it.
Thanks a lot
Rob
Re: cardsize,find,field
Hi Rob,
Best
Klaus
well, you didn't ask for the BEEP command!robm80 wrote:Rather complicated...

Best
Klaus
Re: cardsize,find,field
Hi Rob,
In fact it doesn't work as expectd for me
Testing and cooking again is the way
The same for you second question
Best
Jean-Marc
In fact it doesn't work as expectd for me

Testing and cooking again is the way

The same for you second question
Code: Select all
-- Cd script
--Search all word contain a string in field "myField"
on debSearchString
ask "Search"
if it = empty then exit debSearchString
put it into pString
get getLinesWithString(pString, "myField")
put it into fld "fResult"
setStyleFoundLine it,"myField"
end debSearchString
on setStyleFoundLine pFoundLine,pNameField
set the textstyle of line 1 to -1 of fld pNameField to plain
repeat for each line tLine in pFoundLine
set the textstyle of line (item 2 of tLine) of fld pNameField to box
end repeat
end setStyleFoundLine
function getLinesWithString pString,pNameField -- return a list FoundWord,FoundLine
put empty into rgetLinesWithString
put fld pNameField into stringToSearch
put 0 into tCount
repeat for each word tWord in stringToSearch
add 1 to tCount
if pString is in tWord then
put tWord & "," & tCount & cr after rgetLinesWithString
end if
end repeat
delete char -1 of rgetLinesWithString
return rgetLinesWithString
end getLinesWithString
Jean-Marc
https://alternatic.ch
Re: cardsize,find,field
Dag Rob,
Of course you can set the stack size to whatever you want "on opencard" and "reset" it again "on closecard"!
Best
Klaus
no, the STACK sizes defines the CARD size, not vice versa!robm80 wrote:1. is it possible to change the size of 1 card without resizing the whole stack.
Of course you can set the stack size to whatever you want "on opencard" and "reset" it again "on closecard"!
Let's see, what Jean-Marc comes up with for dinnerrobm80 wrote:2. with find I see a rectangle around the chosen word. How when there are more identical words and I want them all. No such as "find again"?
With the that word I want to do someting with it, f.i. asking position, linenumber, position of first and last char; How?

Put this into the list fields script:robm80 wrote:3. In a scrolling list field I want by pressing a key, the first line beginning with that char scrolls up. Possible?
Code: Select all
on keyUp tKey
put lineOffset(return & tKey, the text of me) into tLineOffset
set the scroll of me to tLineOffset * the effective textHeight of me
end keyUp
Klaus
Re: cardsize,find,field
Gutenacht Klaus
but why it is called once? It gives a number between to keys that has some thing to do with the scroll. Why to multipky it with the the effective textHeight of me
2.I want to follow my scripts with the debugger and I read what was in the tutorials. Here is a discepancy between LC's message box and the mine, and pressing an intelligents button does nothing. Have a look: and
I see that no sufficient pictures are accepted, so read my search story under "search".
Thanks
1. hese 2 lines do exactly what I wanted, but I don't understand the script and how it is working: I know what lineoffset does, but "return & tKey, the text of me) " is to much for me. I suppose thst tKey is a variable,on keyUp tKey
put lineOffset(return & tKey, the text of me) into tLineOffset
set the scroll of me to tLineOffset * the effective textHeight of me
end keyUp
but why it is called once? It gives a number between to keys that has some thing to do with the scroll. Why to multipky it with the the effective textHeight of me
2.I want to follow my scripts with the debugger and I read what was in the tutorials. Here is a discepancy between LC's message box and the mine, and pressing an intelligents button does nothing. Have a look: and
I see that no sufficient pictures are accepted, so read my search story under "search".
Thanks