OT: Analyzing competitors - In this case Real Software

Ken Ray kray at sonsothunder.com
Tue Mar 22 15:48:10 EST 2005

On 3/22/05 2:20 PM, "Richard Gaskin" <ambassador at fourthworld.com> wrote:

> Dan Shafer wrote:
>> On Mar 22, 2005, at 9:47 AM, Mark Wieder wrote:
>>> And,
>>> of course, there's no comparison when it comes to starting a new
>>> project from scratch. At least until you need to get out of the
>>> sandbox and craft an external.
>> Mark, does RB support the creation of externals? I was under the
>> impression it didn't.
> As a lower-level language, in effect everything is like writing what us
> 4GLers consider "externals".


Here's one of my favorites - taken from a RB/Rev comparison doc I wrote up
based on the code provided in the RB Tutorial (which is basically putting
together a simple text editor):

Updating a "font" menu button Based on the currently selected text:

If Me.SelTextFont<>FontMenu.Caption then
End If
Protected Function SetFontMenu(CurrentFont as String) As Integer
  Dim i,nFonts as Integer
  nFonts = Fontcount-1
  For i=0 to nFonts
    If CurrentFont=TextWindow.FontMenu.list(i) then
      Return i
    End If
End Function

put the effective textFont of the selection into tFont
if tFont <> the label of me then
  select line (lineOffset(cr& tFont &cr,cr&btn "FontMenu"&cr)) of
    btn "FontMenu"
end if

or, if you like a one-liner:

select line (lineOffset(cr&(the effective textFont of the selection)
  &cr,cr&btn "FontMenu"&cr)) of btn "FontMenu"


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com

More information about the Use-livecode mailing list