Page 1 of 1

variable interpolation problem b30

PostPosted: Thu Jan 11, 2018 1:29 pm
by vinnie-bob
OK, create a new field on a card and enter some text (one, two, three) one word on each line.

Make a button with script:
Code: Select all
on mouseUp
  find word "two" in cd fld 1
  put foundline() into targetLine
  set the textstyle of targetLine to bold
end mouseUp

Click button and I get "SC Error 2: can't understand arguments" and it seems the problem is the last line of the script.
Foundline returns "line 2 of card field 1" and if you enter "set the textstyle of line 2 of cd fld 1 to bold" in the message box and hit return, that works. Somehow the interpreter is choking on interpolation of targetLine, I think.

Can anyone confirm?


System info:

System Software Overview:

System Version: macOS 10.13.2 (17C205)
Kernel Version: Darwin 17.3.0


Hardware Overview:

Model Name: MacBook Pro
Model Identifier: MacBookPro13,3
Processor Name: Intel Core i7
Processor Speed: 2.9 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB
Boot ROM Version: MBP133.0233.B00

Re: variable interpolation problem b30

PostPosted: Thu Jan 11, 2018 9:51 pm
by johnjohnston1
Hi Vince,
I see the same thing in SC 4.7.3
I think you need to use do
Code: Select all
do "set the textstyle of " & targetline & " to bold"

Which works here in 4.7.3



Re: variable interpolation problem b30

PostPosted: Fri Jan 12, 2018 7:06 pm
by vinnie-bob
Thanks, John. Roundabout, but works.