If your talking about how I built tLine...
Code: Select all
put the text of the mouseLine into tLine
repeat for each character x in tLine
put charToNum(x) & "," after tLine
put tLine
end repeat
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
put the text of the mouseLine into tLine
repeat for each character x in tLine
put charToNum(x) & "," after tLine
put tLine
end repeat
Code: Select all
on mouseUp
put "" into fld 1
repeat with y = 1 to 10
put y into line y of fld 1
-- if y = 5 then put 9 into y
end repeat
end mouseUp
Code: Select all
the number of words in line <x of fld y> = 0
You have known me (on the boards) for about 3 years now, certainly nothing can address my character problems
Well, least I won't get heated about it haha. This is what I'm talking about....
That is because you are much too genteel, except with krill
Oooops. Sry for puzzling you, should have explained better.
Code: Select all
put the text of the mouseLine into tLine -- tLine be "aa"
repeat for each character x in tLine
-- first iteration: x = "a" ============== PseudoCode from here!!!
put charToNum(x) & "," after tLine
put tLine --> "aa97,"
-- second iteration: x = "a" again
put charToNum(x) & "," after tLine
put tLine --> "aa97,97,"
-- third iteration: x = "9" now
put charToNum(x) & "," after tLine
put tLine --> "aa97,97,57,"
-- And so it runs forever 'cause tLine grows faster than you can compute it.
Code: Select all
repeat for each character x in tLine -- another tLine for the loop?
Have fun!
I haven't seen that behavior. We'd need to know how you set the text styling to see why it did that. Was it scripted? Manually selected? If scripted, can we see the relevant part?
Code: Select all
# this script is in the field "txtEnter" script...
on textChanged
checkWord
end textChanged
on checkWord --theWord
lock screen
put word 2 of the selectedLine into tmpLine
put field "txtEnter" into tmpField
put word -1 of line tmpLine of me into theWord
switch
case theWord is among the words of the commandNames
set the textStyle of word -1 of line tmpLine of me to "bold"
break
case theWord is among the words of the functionNames
set the textStyle of word -1 of line tmpLine of me to "italic"
break
case theWord is among the words of the propertyNames
set the textStyle of word -1 of line tmpLine of me to "underline"
break
case theWord
set the textStyle of word -1 of line tmpLine of me to "plain"
break
end switch
unlock screen
Code: Select all
on textChanged
checkWord
end textChanged
on checkWord --theWord
lock screen
put word 2 of the selectedLine into tmpLine
put field "txtEnter" into tmpField
put word -1 of line tmpLine of me into theWord
switch
case theWord is among the words of the commandNames
set the textStyle of word -1 of line tmpLine of me to "bold"
break
case theWord is among the words of the functionNames
set the textStyle of word -1 of line tmpLine of me to "italic"
break
case theWord is among the words of the propertyNames
set the textStyle of word -1 of line tmpLine of me to "underline"
break
default
set the textStyle of word -1 of line tmpLine of me to "plain"
break
end switch
unlock screen
end checkWord
Thanks, I couldn't figure that one out heh, and there wasn't anything about it in 6.x (which is what I am testing this in).
The algorithm works its way through the lists, at each step checking which list's current key was less than or equal to the other. The algorithm failed when it encountered the key "NAN", which is a valid stock market ticker but also a valid floating point number according to the IEEE standard.Davidv wrote: The code is thus a fairly simple step through of both lists, updating when the keys are equal. Logically, it goes in pseudocode:
if key(List1) < key(List2) then move to next List1 key
If key(List1) = key(List2) then update the List 2 line, move to next List2 key
else[ key(List1) > key(List2)] warn the user. -- This is an unlikely event, but when I ran it, I got a user warning on a key which was in both lists. The key in question was the string "NAN".