Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Group:
    FIELDs & CHUNKs

 info D5/601:
      field
      editable
      Chunks
      Anti-alias
      Color Values PropList
 6     4   elements new in Director 6.0,
  !   MANY contain Dictionary fixes 601 & 501,
   +  MANY miss from the 'Appendix' 6.0 for FIELDS.


Field Member (and Chunk) Properties (21):
  !   alignment     of member
      autoTab       of member
  !+  backColor     of member
      border        of member
   +  boxDropShadow of member
   +  boxType       of member
  !   dropShadow    of member
  !   editable      of member
  !   font          of member (and chunk)
  !   fontSize      of member (and chunk)
  !   fontStyle     of member (and chunk)
  !   foreColor     of member (and chunk)
   +  lineCount     of member
  !   lineHeight    of member (and chunk)
      margin        of member
   +  pageHeight    of member
   +  picture       of member (test only)
   +  rect          of member (settable)
   +  scrollTop     of member
      text          of member
      wordWrap      of member

Field & Chunk Editing (21):
  !   char...of
      delete...
   +  EMPTY
x6!+  field (outdated -> member)
  !   item...of
   +  itemDelimiter
   +  last char in...
   +  last item in...
   +  last line in...
   +  last word in...
  !   line...of
      number of chars in...
      number of items in...
   +  number of lines in...
      number of words in...
      put...after
   +  put...before
      put...into
 6 +  SPACE
      text of member
      ...Remember: Editing (chunks of) #field members needs saving!
  !   word...of
      ...see also the STRINGS Lingo Group.

Field & Chunk Functions (17):
      chars()
      charToNum()
      contains...
   +  copyToClipBoard(member)
   +  do...
  !   hilite...
   +  length()
   +  lineHeight()
   +  numToChar()
   +  offset(string)
   +  pasteClipBoardInto(member)
  !+  scrollByLine(member)
      scrollByPage(member)
   +  starts...
      string()
   +  stringP()
   +  value()

Field Member & Chunk Formatting (6):
  !+  backColor             of member
  !   foreColor  [of chunk] of member
  !   font       [of chunk] of member
  !   fontSize   [of chunk] of member
  !   fontStyle  [of chunk] of member
  !   lineHeight [of chunk] of member

Field & Chunk Screen Locations (12):
      charPosToLoc (member)
   +  linePosToLocV(member)
      locToCharPos (member)
      locVtoLinePos(member)
   +  lineCount  of member
   +  pageHeight of member
   +  scrollTop  of member
   +  mouseChar
   +  mouseItem
   +  mouseLine
 6 +  mouseMember
   +  mouseWord

--

Editable Fields and their Scripts (30):
   +  BACKSPACE
   +  charToNum()
   +  contains...
x6 +  dontPassEvent (outdated -> stopEvent)
  !   editable of member
  !   editable of sprite
   +  EMPTY
   +  ENTER
  !   hilite...
   +  key
   +  keyCode
   +  keyDownScript
   +  keyPressed
   +  keyUpScript
   +  lastKey
   +  length()
   +  on keyDown
   +  on keyUp
   +  numToChar()
   +  pass  (also exits immediately)
   +  RETURN
   +  selection
      selEnd
      selStart
 6 +  SPACE
   +  starts...
 6 +  stopEvent  (without exiting)
   +  TAB
   +  timeoutKeyDown
   +  value()

--

601 FIELD Lingo:
The keyword 'field' is outdated, use 'member' instead.
But you CANNOT 'set myString = member "myField"', which
will result in 'myString = (member x of castLib y)';
use 'set myString = the text of member "myField"' instead!

6.0 'Appendix' errors for FIELDS (3):
Many elements are missing, see (+) above.
The entry 'char PosToLoc' should read: 'charPosToLoc'.
The entries 'height of member' and 'lineSize of member'
have nothing to do with #field; they apply to #shape.

Outdated FIELD Lingo (7):
 5        textAlign of field -> alignment  of member
 5         textFont of field -> font       of member
 5       textHeight of field -> lineHeight of member
 5         textSize of field -> fontSize   of member
 5        textStyle of field -> fontStyle  of member
 6                     field -> member
 6                 mouseCast -> mouseMember





[index] _ D5/601 _ 971212:


alignment of member

field member display property

6.0 Dictionary Errors, same in 5.0:

'...a string consisting of..."left, " "center, " or "right. " '
= Wrong syntax; should read:
'...a string consisting of..."left", "center", or "right". '

"The parameter 'whichCastmember' can be either
 a cast name or cast number."
= Wrong syntax; should read:
"The parameter 'whichCastmember' can be either
 a MEMBER name or number."

= Missing:
'The default 'alignment of member' for a field is "left", but sometimes
 a duplicated or copied and pasted field changes to "center"!'

...The last paragraph is doubled; delete it!

"See Also" mentions ampersand '&' and '&&'. Why?
 --

The 5.0 Dictionary calls this sweet little property
  'ALIGN of member'; no work! :-(
  --

1. TIP: No stage update or puppet is needed when changing 'the alignment' of a field MEMBER, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. All text or property changes to a field member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.

2. TIP: You CANNOT test or set 'the alignment' of single chunks of a field member, as this property belongs to the field member as whole.

3. TIP: In Director 4, the 'alignment of member' was called 'the textAlign of cast'.






[index] _ D5/601 _ 971212:


"Anti-alias"

richText appearance

Sorry, there is NO Lingo property representing this #richText member setting, but here's some info on the new kind of text called 'RTFM' or 'rich text formatted member' in Director 5.0 and 6.0:

Any text file you import into Director will automatically be put into a castLib as a #richText member, and it will have the default setting for anti-aliasing its text if 'Larger than 12'. This means that anti-aliasing only applies to font sizes of 14 and higher in that richText member. You must manually change the 'anti-alias' setting of a richText member in its 'Cast Member Properties' dialog box, or turn it off if you don't want any anti-aliasing of your richText on stage.

If you don't need 'anti-aliasing', better use a FIELD member on stage instead, adjust its member and its sprite settings, and then copy the text from the #richText member into the field member (and finally delete the richText member from its castLib).

Remember: RichText members are converted to bitmaps during run-time AND during author-time, and they quickly become VERY big in size and in memory. But this way #richText members keep their font settings across different computers and platforms, even while authoring as long as you don't edit them on a machine where their special font is not installed! For different platforms, you NEED a specialized FONTMAP.TXT to map the used fonts to each computer!

Daniel Devolder (Barcelona) came up with the following possibility to change a #field or a #richText into a bitmap, works in author-time and run-time: 'set the picture of member aBitMap = the picture of member aTextFieldOrRichText'.






[index] _ D5/601 _ 971212:


backColor of member

field member property

6.0 Dictionary Errors, partly the same in 5.0:

"Syntax:  set the backColor of member...to colorNumber"
= Too much; should read:
"Syntax:  the backColor of member whichCastmember"

"This...property sets the background color..."
= Test AND set; should read:
"This...property DETERMINES the background color..."

"...value depends on the color depth...ranges from...8-bit...4-bit..."
= Not enough; should read:
"...value depends on the color depth...ranges from...4-bit...8-bit...
    16-bit...32-bit..."

...I'd suggest using the value of another field's 'foreColor'
   whenever setting any kind of colors in any colorDepth.

"This statement changes the color of the characters..."
= The Example should read:
"This statement changes the BACKGROUND OF THE FIELD MEMBER..."

...The 'backColor of member' belongs to the whole member,
   not to single characters or chunks!
   Remember: If characters have the same 'foreColor' as the
   'backColor', then they will become invisible... ;-)

= Missing:
"See Also: field, foreColor of member, backColor of sprite"
 --

1. TIP: You CANNOT test or set 'the backColor' of single chunks of a field member, as this property belongs to the field member as whole.

2. TIP: No stage update or puppet is needed when changing 'the backColor' of a field MEMBER, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change (opposed to when changing 'the backColor of SPRITE' for shapes and 1-bit). All text or property changes to a field member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.

3. TIP: Remember: The 'backColor of member' works on FIELD members only, the 'backColor of sprite' works only on shapes and 1-bit sprites; both need different handling. In 16-bit and higher color depth, field members display in thausands or in RGB colors, whereas the 'backColor of sprite' is ALWAYS dependant on some kind of current palette, which is either the movie's own palette or the default Mac System palette.

4. TIP: Except for 0=white, it's recommended NOT to use absolute color values (1 to 255) from a 8-bit palette, but to retrieve the desired color value from a reference member's or chunk's 'foreColor' instead. For a workaround, see 'foreColor of member'.






[index] _ D5/601 _ 971212:


char...of

field member, chunk and string expression keyword

6.0 Dictionary Errors, partly the same in 5.0:

"You can test but not set the 'char...of' keyword"
= Missing:
"...you have to use 'put...into char...of'.
 You can also 'put...before' and 'put...after' it."

= Missing:
"If you test a single char at a position higher than
'the number of chars in...', you get EMPTY ("").
 If you 'put...into' a single char at such an position,
 you create new chars (white spaces) up to that position."

'set char 1...of member "quiz" to "?????"'
= Example 3 will NOT work! You cannot SET this thing! Ha, ha!
  Should read:
'PUT "?????" into char 1...of member "quiz"'

= Missing:
"See Also: ... the mouseChar, the last char in,
 field, put...after/before/into, delete, hilite"
 --

From the '601 ReadMe':
  Deleting characters '10 to 1' out of a string with 
  'delete char 10 to 1 of aString' no longer crashes.
= Missing: This expression does NOT do anything!
  --

1. TIP: The chunk expressions 'char x of...' and 'char x to y of...' relate to a field castMember or a string variable, or a part of either. The Dictionary calls that 'chunks' or 'chunk expressions'.

2. TIP: A 'char' is NOT delimited by anything -- opposed to the other 3 chunks: 'word...of', 'line...of', 'item...of'.

3. TIP: A 'char' can be any character, including a white space, a quotation mark, and a RETURN.

4. TIP: Use Lingo's function 'numToChar()' to convert ASCII or ANSI characters into a 'char', but not all of them will be displayed correctly. Use 'charToNum()' to change a 'char' into its ASCII value. Remember: Macintosh uses the ASCII letter set, but Windows uses the partly different ANSI set; only the 128 standard ASCII characters (1-0,a-Z) have identical IDs in both sets. Remember also to load Director's special ASCII <-> ANSI conversion table FONTMAP.TXT (in the Movie Properties dialog box) from the program's directory into every movie of yours that uses text in field members. Rob Dillon from www.ddg-designs.com mentions that Director does not remap text that is in toolbox buttons.

5. TIP: To test how many chars are in a chunk, use 'length(chunkExpression)' or 'the number of chars in chunkExpression', which returns the integer number of the last char. Use 'the last char of...' to see what's in that last char.

6. TIP: If you put EMPTY or "" into a single 'char', it's deleted and will disappear.

7. TIP: Remember: If you import text files on Windows, TWO characters are used for line breaks: RETURN + numToChar(10). When you port such richText or field members to the Macintosh, the Line Feed character numToChar(10) will be shown at the beginning of the next line, and 'the number of chars in chunkExpression' will increase by the amount of numToChar(10) in your text.

8. TIP: You can simply add chars together by using the '&' operator (the Lingo concatenator).

9. TIP: You can test AND set text formattings and 'the foreColor' for chunks of field members, like 'the font of char 6 of word 1 of member whichFieldMember', but remember: Field manipulations are time consuming.

10. TIP: Test 'the mouseChar' to get the number of the char of a field sprite the mouse is over, the 'mouseChar' returns -1 if the cursor is not over ANY char on stage, or if it is over some inappropriate part of a field like the border or scroll bar. If the mouse is over empty space beyond the last char in the field, 'the mouseChar' returns the number of the last char of that field, use the 'length()' function to compare. And remember: The 'mouseChar' reacts to the center of your cursor, and NOT to its 'regPoint' (its hot spot). Test 'the mouseCast' and 'the type of member (the mouseCast)' to see if and which field sprite the mouse is over. In 6.0, test 'the mouseMember', which returns VOID if over no sprite.

11. TIP: If you test or 'put...into' char -1 or 0, you will get or change the entire chunk expression.

12. TIP: If you test char 99, and 99 is higher than 'the number of chars in chunkExpression' or 'length(chunkExpression)', you'll get an EMPTY string (""). If you 'put...into' char 99 in this case, you'll automatically fill up the missing chars up to 99 with white spaces.

13. TIP: You can retrieve and delete 'the last char of chunkExpression', but you CANNOT 'put...into' this expression. If you want to change the last char, use: 'put...into char (the number of chars in chunkExpression) of chunkExpression'.

14. TIP: To change char x:
'put (something) into char x of chunkExpression'

15. TIP: To add something before char x:
'put (something) before char x of chunkExpression'.

16. TIP: To add something after char x:
'put (something) after char x of chunkExpression'.

17. TIP: To delete char x:
'delete char x of chunkExpression', or:
'put EMPTY into char x of chunkExpression'.

--

EXAMPLEs:

put char 1 of EMPTY
-- ""
--
set x = "Ldoc+"
--
put char -1 of x
-- "Ldoc+"
put char  0 of x
-- "Ldoc+"
put char  1 of x
-- "L"
put char  5 of x
-- "+"
put char  6 of x
-- ""

put ("ingo ") after char 1 of x
put x
-- "Lingo doc+"

put "Bingo Game" into char 1 to 5 of x
put x
-- "Bingo Game doc+"

delete the last char of x
put x
-- "Bingo Game doc"





[index] _ D5/601 _ 971212:


"Chunks"

the docs' expression for parts of strings and field members

No, no, 'chunk' is NOT a valid Lingo expression, but the words 'chunk', 'chunkExpression' and 'string container' are used in the docs to describe the following (5.0 'Lingo Dictionary' on page 22 and 110):
" Chunk expressions are used to refer to any character, word, item, or line in any source of strings such as field members and variables that hold strings. "
" Chunk expressions refer to any character, word, item, or line in any container of strings. Containers include field members and variables that hold strings, and specified characters, words, items, lines, and ranges in containers. "

Remember to load Director's special ASCII <-> ANSI conversion table FONTMAP.TXT (in the Movie Properties dialog box) from the program's directory into every movie of yours that uses text in field members. You can edit that FONTMAP.TXT to your own needs, before importing it. Rob Dillon from www.ddg-designs.com mentions that Director does not remap text that is in toolbox buttons.






[index] _ D5/601 _ 971212:


dropShadow of member

field member text display property

6.0 Dictionary Errors, partly the same in 5.0:

"...determines the size of the drop shadow for text..."
= Not exact; should read:
"...determines the DISTANCE of the 1-pixel drop shadow
    down and to the right of the text..."

"Possible values are a range of pixels."
= Not enough; should read:
"Possible values are an amount of pixels between 0 and 127."

= Missing:
"This property can be tested and set; its default value is 0.
 It's the same as setting this property in Director's
 'Modify - Borders - Text Shadow...' menu for a field
 castMember (where only 0 - 5 pixels are possible)."

= Missing:
"See Also: boxDropShadow of member, boxType of member,
 border of member, field"
 --

"...determines the size of the field cast member's drop shadow."
= The 5.0 Dictionary should read:
"...determines the DISTANCE of the 1-pixel drop shadow
    down and to the right of the text in a field castMember."
...'the field's drop shadow' is the 'boxDropShadow of member'!
   --

1. TIP: No stage update or puppet is needed when changing 'the dropShadow' of a field MEMBER, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. All text or property changes to a field member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.

2. TIP: You CANNOT test or set 'the dropShadow' of single chunks of a field member, as this property belongs to the field member as whole.

3. TIP: On Windows (and sometimes on Macintosh), if during run-time you change the text in a field member that has its 'dropShadow of member' turned on, you might end up with left-over black pixels on the screen from the shadow of the text before. One way to reduce this is to set the field member's 'Framing:' property to 'Fixed' and then make it at least 3 pixels higher than the actual 'lineHeight of member': Pull the bottom side of the field sprite on the stage 3 pixels down.






[index] _ D5/601 _ 971212:


editable of member

field member's text editing property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"This property can be tested and set; its default value is FALSE.
 The 'editable of sprite' and the Editable checkbox in Director's
 Score interface will override the 'editable of member' setting."

= Missing:
"See Also: field, autoTab of member, editable of sprite,
 on keyDown, on keyUp, the keyDownScript, the keyUpScript"
 --

From the '6.0 ReadMe':
  It is not recommended to use editable media (like fields or text
  cast members that are modified using lingo) in URL-linked castLibs.
  If this is done, and the movie is played, thereby editing the media,
  the movie cannot be saved without also saving the castLib.
  When the castLib is saved, the local version will be linked
  to the movie; then the movie must either be re-linked to
  the original URL or the castLib relative to the movie (locally
  when the movie is local, and remotely when the movie is remote).
  --

1. TIP: Remember when using editable fields: If you apply any INK effect other than 'Copy' (ink number 0) to an editable field sprite on stage, that field will NOT be editable in a projector or browser.

2. TIP: Remember: The 'editable of member' (called 'editableText of cast' in earlier versions) works on the field member, but the 'editable of sprite' only works on a single SPRITE appearance of that MEMBER on stage; both need different handling. The sprite setting overrides Lingo's 'editable of member' setting for a field member, which again overrides the member's setting in its 'Cast Member Properties' dialog box.

3. TIP: No stage update or 'puppet' is needed when changing the 'editable of member' for a field MEMBER, because all SPRITE appearances of that field in your movie update immediately and persistently (opposed to changing the 'editable of SPRITE', which needs both a stage update AND a 'puppet' to take effect on stage). All text or property changes to a field member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler. Lingo can succesfully turn the 'editable of member' on without the 'editable of sprite' being TRUE. But if the 'editable of sprite' if TRUE, turning off the 'editable of member' will work, but without effect for the given (puppeted) sprite.

4. TIP: You CANNOT test or set 'the editable' of single chunks of a field member, as this property belongs to the field member as whole.

5. TIP: Remember: If the user presses RETURN, there will be a line break in your editable field. If you don't want RETURNs passed to your field, then 'set the keyDownScript = "if the key = RETURN then dontPassEvent" ' in 5.0, and in 6.0: 'set the keyDownScript = "if the key = RETURN then stopEvent" '. Remember: If a field member's 'Framing:' is set to 'Adjust to Fit', it will NOT expand when the user types in more text than fits into it. So decide if you want the field's 'wordWrap of member' to be turned on (in its 'Cast Member Properties' dialog box), otherwise overflowing text will disapear underneath the right border of the editable field sprite.

6. TIP: Remember: A field CANNOT contain a TAB, as this is used to 'Tab to Next Field' and focus the next editable field sprite on stage. But in your 'on keyDown' handler or 'keyDownScript', you can catch the TAB and put some white spaces in your field when it occurs: 'if (the key = TAB) then put ("   ") before char (the selStart) of field (the mouseCast)' (in 6.0, use 'the mouseMember').

7. TIP: Director 3.0 - 6.0: If you move an editable field sprite offstage, its text cursor (the blinking insertion caret) or even a possible selection of text will stay printed on the screen. See 'editable of sprite' for a workaround.

8. TIP: When you use the 'Copy & Paste' functions from Director's authoring environment to copy text between field or richText members, Director copies the text, including ALL formattings, styles and colors in it.
Remember: During run-time, these 'Copy & Paste' functions are NOT enabled. To enable the copying of (pure) text, you'd have to program 'Copy & Paste' functions by yourself with Lingo, putting 'the selection' into another field and then using 'copyToClipBoard' for that field.

9. TIP: See also Editable Fields and their Scripts, and check out Gretchen's 501 BugList and 601 BugList for Director problems with editable fields ans sprites.






[index] _ D5/601 _ 971212:


editable of sprite

field sprite editing property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'editable of sprite' needs a stage update.
 The default value is FALSE."

"When the field...'the editable of sprite' property is TRUE."
= The sentences in both bullets should be turned around:
"When the 'editable of sprite' is set to TRUE,
 the field can be edited by the user" etc.

= Missing:
"The 'editable of sprite' and the Editable checkbox in Director's
 Score interface will override the 'editable of member' setting."

= Missing:
"See Also: field, editable of member, autoTab of member,
 on keyDown, on keyUp, the keyDownScript, the keyUpScript"
 --

From the '6.0 ReadMe':
  If  the "Allow Outdated Lingo" option was set for a movie
  in Director 5, the 'moveableSprite of sprite' and the
  'editable of sprite' were not puppetable. They are now.
  --

From the '501 ReadMe':
  If you apply any INK effect other than 'Copy' (ink number 0)
  to an editable field sprite on stage, that field will NOT be
  editable in a projector or browser.
  --

1. TIP: Remember: The 'editable of sprite' only works on a single SPRITE appearance of a field MEMBER on stage, but the 'editable of member' works on the field MEMBER itself; both need different handling. The sprite setting overrides Lingo's 'editable of member' setting for a field member, which again overrides the member's setting in its 'Cast Member Properties' dialog box. But Lingo can succesfully turn the 'editable of member' on without the 'editable of sprite' being TRUE. And if the 'editable of sprite' if TRUE, turning off the 'editable of member' will work, but without effect for the given (puppeted) sprite.

2. TIP: Director 3.0 - 6.0: If you move an editable sprite offstage, its text cursor (the blinking insertion caret) or even a possible selection of text will stay printed on the screen. This 'trails' effect seems to not be covered by another sprite on top. This behavior has also been reported for MIAW's with editable fields on stage, where a ghost of the selection or caret appeared toward the top left of the stage after deleting the MIAW.
Workarounds:
You can turn 'the editable of sprite' to FALSE for the editable text field(s) before moving, or set both 'the selStart' and 'the selEnd' to -1 before you move your editable field offstage.

3. TIP: See 'editable of member' for more info.






[index] _ D5/601 _ 971212:


field

string text member keyword

6.0 Dictionary Errors, partly the same in 5.0:

"This keyword refers to the field cast member..."
= Not enough; should read:
"This keyword refers to the field castMember...or its string content."

"For new movies, use 'member' to refer to field cast members."
= Not enough; should read:
"For new movies, use 'member' to refer to field castMembers,
 and use 'the text of member' to refer to their string content."

...you CANNOT use ALL string or chunk expressions together with
   the 'member' keyword as you can with the 'field' keyword!

"This statement puts...of the field name entry..."
= Small typo in Example 1; should read:
"This statement puts...of the field named 'entry'..."

'set myKeyword = char 5 to 10 of field "entry" '
= Example 1 should also mention:
'set myKeyword = char 5 to 10 of the text of member "entry" '

'if member "bid" contains "desk" then...'
= Example 2 will NOT work! Shame! Should read:
'if field "bid" contains "desk" then...'
'if the text of member "bid" contains "desk" then...'

...the expression 'member "bid"' contains '(member x of castLib y)'!

= Missing:
"See Also: ... text of member, hilite, number of...in,
 contains, starts, offset(), EMPTY, SPACE"
 --

1. TIP: The 6.0 Dictionary: The term 'field' is becoming outdated, use the term 'member' instead. But you CANNOT 'set myString = member "myField" ', which will result in 'myString = (member x of castLib y)'; use 'set myString = the text of member "myField" ' instead! Same applies to other string functions.

2. TIP: Remember: It's very time consuming to test or set ANY properties of string text in a field.

3. TIP: Remember to load Director's special ASCII <-> ANSI conversion table FONTMAP.TXT (in the Movie Properties dialog box) from the program's directory into every movie of yours that uses text in field members. You can edit that FONTMAP.TXT to your own needs and place it in your working directory before importing it. Rob Dillon from www.ddg-designs.com mentions that Director does not remap text that is in toolbox buttons (created with Director's Tool Palette window).

4. TIP: You can also test AND set the text formattings 'font / fontSize / fontStyle / foreColor / lineHeight' of single chunks of a field member (chars, words, lines, items). When you test the formattings of a field member or chunks of it, you will always retrieve the format of the FIRST char in it only.

5. TIP: No stage update or 'puppet' needed when changing properties of a field member or chunks of it, because all SPRITE appearances of that MEMBER in your movie update immediately and persistently; and you CANNOT use a transition effect for the change. See the next TIP for a workaround.

6. TIP: Take into consideration that fields on stage are not affected by setting 'the updateLock' to TRUE: A field will immediately update as soon as you change its text content or appearance. Workaround: To keep a field from updating, you need to set its 'trails of sprite' to TRUE, do an 'updateStage', move the fields 'locV' offstage with 'set the locV of sprite x = (the locV of sprite x) - 500..updateStage'. Now the field has printed its picture on stage and you can change the field's content offstage, then move it back to its position 'locV + 500', set its 'trails' to FALSE, and then update the stage (no puppet needed for these temporary changes if they take place inside a handler).
Another workaround to keep a field (or many fields) from being updated immediately is to put the fields into a filmloop, make changes to them, and then update all changes with 'set the media of member "myFilmLoop" to the media of member "myFilmLoop" '. Works great and is even a good way to synchronize various fields.

7. TIP: Remember: ALL changes to a FIELD member or its text content or appearance will be saved with your movie, unless you reset it manually or in your 'on stopMovie' handler. This also includes the scroll position of scrolling field members. Be sure to remember to scroll all your fields (back) to the top, or to place their text cursors at the beginning, before protecting your Director movies in final stage. You can also use 'put EMPTY before field "MyField"', or 'set the scrollTop of member "MyField" = 0', to ensure that a scrolling field displays its first line everytime it appears on stage, because once the user has scrolled it, it will stay at the scrolled position.

8. TIP: To retrieve the chunk (part) of a text field which is under the mouse pointer, you can test 'the mouseChar / mouseItem / mouseLine / mouseWord' to get the integer NUMBER of the chunk in the field; test 'the mouseCast' (in 6.0, use 'the mouseMember') to get the castMember number of that field: 'put "abc" into char (the mouseChar) of field (the mouseCast)'.

9. TIP: There is no valid way in Lingo to change the size of a field on stage (except for changing its 'rect of member'), so when you exchange field members, be sure to have their sizes pre-adjusted manually in Director's Field window. For scrolling fields you even have to pre-adjust their length by placing each one on stage and then moving the bottom sprite size handle to the desired position, and you will need to check the 'Modify - Sprite - Properties' each time to see if the height (and width) is exactly the number of pixels you want.

10. TIP: Daniel Devolder (Barcelona) came up with the following possibility to change a field or a richText into a bitmap, works in author-time and run-time: 'set the picture of member aBitMap = the picture of member aTextField/aRichText'.

11. TIP: For movies created in Director 5 or 6, the 'type of member' returns '#field' for field members, and '#richText' for text members. However, field members originally created in Director 4 still return '#text' for their 'type of member' (for backward compatibility with Director 4 movies).

12. TIP: If you use a scrolling field and want to detect when the user clicks the scroll bar, then bear in mind:
(a) you CANNOT detect a 'mouseUp' anywhere on a scroll bar, because that's a System function which Director uses for scrolling fields;
(b) you can have an 'on mouseDown' handler in the field's sprite or castMember script, which also reacts when the scroll bar is used, but you might block the scroll bar, and the user might have to click twice or hold the mouse for the scrolling to happen;
(c) you can put a not-filled shape sprite, no border, white on white, and with 'copy' ink on top of the scroll bar (without any script), and then use a 'rollOver()' detection on this covering area in the 'on mouseDown' handler of the field sprite's script. And possibly set a global flag variable when you find that the user clicked the scroll bar, which can then be evaluated and initialize some Lingo, which can also be done in a frame script.

Check out Gretchen's 501 BugList and 601 BugList for Director problems with fields.






[index] _ D5/601 _ 971212:


font

text property of field members and chunks of them

6.0 Dictionary Errors, same in 5.0:

"When tested, it returns the HEIGHT of the first LINE of the field."
= Completely wrong; should read:
"When tested, it returns a string containing the NAME of the
 FONT of the FIRST CHAR of the field castMember or the chunk."

= Missing:
"This property can be tested and set, also for chunks of a field.
 Its value is a string containing the official name of the used font.
 Note: Font names differ on Macintosh and on Windows,
 for example "Times" on Mac is "Times New Roman" on Windows!
 Remember to prepare and import a FONTMAP.TXT to map different
 fonts between platforms."

= Missing:
"See Also: ... field, backColor of member, foreColor of member,
 lineHeight() function, char...of, item...of, line...of, word...of"
 --

From the '601 ReadMe':
  Setting the 'font of member' or the 'fontSize of member' for
  field castMembers created through Lingo now works properly.
  --

From 'Macromedia Director Corrections':
  The 2nd paragraph in the 'font' entry should be deleted entirely.
  Also, the 'font of member' can be tested and set.
  --

1. TIP: No stage update or puppet is needed when changing 'the font' of a field MEMBER or chunk of it, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. See 'field' for a workaround.

2. TIP: According to Gretchen's 501 BugList, you CANNOT set the font of a field with Lingo permanently in a Director movie that was created on Macintosh using a font mapping table, and then opened in Director on Windows. (?)

3. TIP: You can also test AND set 'the font' of single chunks of a field member (chars, words, lines, items), which applies to other formattings as well. When you test a field member or chunk of it, the 'font' returns a string with the name of the typeface (like "Courier") of the FIRST CHAR in it only, same with other formattings. Remember: It's very time consuming to test or set any properties of text in a field.






[index] _ D5/601 _ 971212:


fontSize

text property of field members and chunks of them

6.0 Dictionary Errors, same in 5.0:

= Missing:
"When tested, it returns the size of the font
 of the FIRST CHAR of the field castMember or the chunk.
 It can also be tested and set for chunks of a field."

= Missing:
"See Also: ... field, fontStyle of member, backColor
 of member, foreColor of member, lineHeight() function,
 char...of, item...of, line...of, word...of"
 --

From the '601 ReadMe':
  Setting the 'font of member' or the 'fontSize of member' for
  field castMembers created through Lingo now works properly.
  --

1. TIP: No stage update or puppet is needed when changing 'the fontSize' of a field MEMBER or chunk of it, because all SPRITE appearances of that field in your movie are updated immediately and will persist, and you CANNOT use a transition effect for the change. See 'field' for a workaround.

2. TIP: Remember: The value for 'the fontSize' is NOT equal to the value that the 'lineHeight of member' proeprty or the 'lineHeight()' function indicate for a given field line: The 'lineHeight' is the size of the used font plus the pixels of white space between the lines.

3. TIP: You can also test AND set 'the fontSize' of single chunks of a field member (chars, words, lines, items), which applies to other formattings as well. When you test a field member or chunk of it, the 'fontSize' returns the size in pixel of the font of the FIRST CHAR in it only, same with other formattings. Remember: It's very time consuming to test or set any properties of text in a field.






[index] _ D5/601 _ 971212:


fontStyle

text property of field members and chunks of them

6.0 Dictionary Errors, same in 5.0:

"...determines the styles applied to the font..."
= Not exact; should read:
"...determines the style or multiple styles applied to the font..."

= Missing:
"When tested, it returns a string containing the fontStyle(s)
 of the FIRST CHAR of the field castMember or the chunk.
 It's default value is 'plain'. It can also be tested and set
 for chunks of a field."

"The value...is a string of styles delimited by commas."
= Not exact; should read:
"The value...is a string containing one style, or multiple styles
 delimited by commas."

"The available styles are..."
= Not exact; should read:
"The available styles are 'plain', 'bold', 'underline', and 'italic'
 for Windows and Macintosh, and 'shadow', outline', 'extend', and
 'condense' for Macintosh, depending on the used font supplying
 display versions for such settings."

"This statement sets...for the field cast member Rokujo Speaks..."
= Example 3 should read:
"This statement sets...for the field castMember POEM..."

= Missing:
"See Also: ... field, backColor of member, foreColor of member,
 lineHeight() function, char...of, item...of, line...of, word...of"
 --

From the '601 ReadMe':
  Setting the 'font of member' or the 'fontSize of member' for
  field castMembers created through Lingo now works properly.
= Missing: I guess this includes 'fontStyle of member' as well.
  --

"...use the word "normal" to remove all of the styles..."
= The 5.0 Dictionary should read:
"...use the word "plain" to remove all of the styles..."
  --

1. TIP: No stage update or puppet is needed when changing 'the fontStyle' of a field MEMBER or chunk of it, because all SPRITE appearances of that field in your movie are updated immediately and will persist, and you CANNOT use a transition effect for the change. See 'field' for a workaround.

2. TIP: When using multiple font styles in a field or chunk of it, you can ADD another style to it by just setting its 'fontStyle' to the new style, or you can repeat all its styles in the new setting, but you CANNOT turn one of the styles off, and setting 'the fontStyle' to the style's name again won't help (like in the 'Text Inspector' window, where you click on 'B'old again to get rid of it). You have to strip your text of all styles by setting its 'fontStyle' to 'plain', and then again set your text to the other styles you want it to keep.

3. TIP: You can also test AND set 'the fontStyle' of single chunks of a field member (chars, words, lines, items), which applies to other formattings as well. When you test a field member or chunk of it, the 'fontStyle' returns a string containing the fontStyle(s) of the FIRST CHAR in it only, same with other formattings. Remember: It's very time consuming to test or set any properties of text in a field.

--

EXAMPLEs:

The following shows the values for a multiple styled word in a field member:
put the fontStyle of word 3 of field "MyField"
-- "bold,italic"
--
set the fontStyle of word 3 of field "MyField" = "underline"
put the fontStyle of word 3 of field "MyField"
-- "bold,italic,underline"
--
--> ...now it's also underlined.
--> So lets try to get rid of the "italic" style:
--
set the fontStyle of word 3 of field "MyField" = "italic"
put the fontStyle of word 3 of field "MyField"
-- "bold,italic,underline"
--
set the fontStyle of word 3 of field "MyField" = "not italic"
put the fontStyle of word 3 of field "MyField"
-- "bold,italic,underline"
--
--> ...nothing works. You have to first change it to "plain",
--> which might be irritating in a field on stage:
--
set the fontStyle of word 3 of field "MyField" = "plain"
put the fontStyle of word 3 of field "MyField"
-- "plain"
set the fontStyle of word 3 of field "MyField" = "bold,underline"
--
put NOT (the fontStyle of word 3 of field "MyField" = "plain")
-- 1





[index] _ D5/601 _ 971212:


foreColor of member

text property of field members and chunks of them

6.0 Dictionary Errors, same in 5.0:

"Syntax:  set the foreColor of member...to colorNumber"
= Too much; should read:
"Syntax:  the foreColor of member whichCastmember"

"This...property sets the foreground color..."
= Test AND set; should read:
"This...property DETERMINES the foreground color..."

= Missing:
"When tested, it returns the foreColor of the FIRST CHAR
 of the field castMember or the chunk in it.
 It can also be tested and set for chunks of a field.
 The value depends on the color depth of the monitor,
 which ranges from 4-bit, 8-bit, 16-bit, and 32-bit."

...I'd suggest using the value of another field's 'foreColor'
   whenever setting any kind of colors in any colorDepth.
   Remember: If characters have the same 'foreColor' as the
   'backColor', then they will become invisible... ;-)

= Missing:
"See Also: field, backColor of member, font of member,
 fontSize of member, fontStyle of member, the stageColor,
 char...of, item...of, line...of, word...of"
 --

1. TIP: You can also test AND set 'the foreColor' of single chunks of a field member (chars,words,lines,items). When you test a field member or chunk of it, the 'foreColor' only returns the color value of the FIRST CHAR in it. Remember: It's very time consuming to test or set any properties of text in a field.

2. TIP: No stage update or puppet is needed when changing 'the foreColor' for a field MEMBER or chunk of it, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change (opposed to when changing the 'foreColor of SPRITE'). See 'field' for a workaround.

3. TIP: Remember: The 'foreColor of member' works on FIELD members only, the 'foreColor of sprite' works only on shapes and 1-bit sprites; both need different handling. In 16-bit and higher color depth, field members display in thausands or in RGB colors, whereas the 'foreColor of sprite' is ALWAYS dependant on some kind of current palette, which is either the movie's own palette or the default Mac System palette.

4. TIP: According to Gretchen's 501 BugList, on Windows the 'foreColor' of a field reverts to black as soon as you put any new text into it.

5. TIP: Except for 0=white, it's recommended NOT to use absolute color values (1 to 255) from a 8-bit palette, but to retrieve the desired color value from a reference member's or chunk's forecolor instead. The color value for a given RGB color is different relative to the color resolution of the monitor: a color from position 2 in a 256 color palette in 8-bit display will have a totally different value (position) each in 16-, 24- and 32-bit color resolutions.

--

EXAMPLE:

Since Director 3.0 first introduced all the field and string chunk expressions (char, item, line, word) and their manipulation possibilities, I've been using the following easy technique to create a global database list with my favourite color names and their respective color values. To retrieve values for colors according to 'the colorDepth' of the monitor, create a field "MyColors". In this field write the (fantasy) names of the colors that you want to have handy in you project for changing FIELD MEMBERS, CHUNKS, or SPRITES: Write each color name in one word, delimite the color names with commas, i.e. "Gold,Orange,Orchid,...". This way you'll create 'items' in a simple string listing. Then select your color names one after the other with the mouse, and apply the desired color to the word itself with the Color Chip from Director's floating Tool Palette window. Use any background color you like for that field. You can also use names for your colors that indicate their usage in a project: i.e. "Background,QuitButton,...".

The following Lingo handler "on getColor myColor, myNewValue" will first go and retrieve each color name together with the value of its 'foreColor' out of your field "MyColors" -- according to the actual monitor setting. This can take a couple of 'ticks', especially if you use many color names... The handler stores each color together with its value in a global property list called "gColorList", in the format of '[ #colorName : colorValue ]', using symbols for the color names. Once initialized, you don't need to know the name of the (encapsuled) global list variable 'gColorList', because the 'getColor()' handler will handle everything for you and return color values for color names: 'set x = getColor(#Orange)', or look for and return the color name for a given value if it's in the list: 'put getColor(255)'.

Call 'getColor(#init)' once from your project's 'on startMovie' handler, and later on, when you want Lingo to change the 'foreColor' of FIELDS or CHUNKS, or the 'backColor' or 'foreColor' of shapes, buttons and 1-bit SPRITES on stage, you can get their color set to one of the values from your personal color list by using: 'set the foreColor of member "myField" = getColor(#yourColorName)'.

Because the colored text items in the field "MyColors" will have different 'foreColor' values themselves when retrieved during run-time under different monitor settings (8-bit, 16-bit, 32-bit), the 'getColor()' handler will serve the correct color values for your colors in every possible monitor setting:

on getColor myColor, myNewValue
  --
  --> Scripted by Denis Wieger <Denis@a3w.de> on 971201.
  --
  global gColorList

  
  if voidP(myColor) OR (myColor=#init) then  --> init...
    --
    --> create the encapsuled global 'gColorList' and and sort it:
    --
    set  gColorList = [:]
    sort(gColorList)  --> makes it work faster...
    --
    --> get the itemDelimited text from your special colored field:
    --
    set itemList  = the text of field "MyColors"
    set itemCount = the number of items in itemList
    ---
    
    repeat with ii = 1 to itemCount
      --
      --> get the name for each color and convert it to a symbol:
      --
      set thisName  = value( "#" & item ii of itemList)
      --
      --> ...now get the color value from each item's foreColor:
      --
      set thisValue = the foreColor of item ii of field "MyColors"
      --
      --> ...and create an entry in the list of colors:
      --
      if symbolP(thisName) then
        addProp(gColorList, thisName, thisValue)
      end if
      --
    end repeat
    ---
    
    put RETURN& "List of Colors:" &RETURN &gColorList &ETURN
    ---
    return(gColorList)
    --
  end if
  ------


  if NOT ilk(gColorList, #propList) then  --> first initialize it:
    getColor(#init)
  end if
  ---
  if NOT symbolP(myColor) then --> convert possible string to symbol:
    set myColor = value("#" & myColor)
  end if
  ------


  if voidP(myNewValue) then  --> just return a color value or a name:
    --
    if       symbolP(myColor) then --> get value for given color name:
      return(getaProp(gColorList, myColor))
    --
    else if integerP(myColor) then --> get color name for given value:
      return( getOne( gColorList, myColor))
    --
    else return(-1)
    ----


  else if integerP(myNewValue) then --> enter or set a new color value:
    --
    setaProp(gColorList, myColor, myNewValue)  --> set (new) property.
    --
    return(findPos(gColorList, myColor))  --> return its list position.
    --
  else return(-1)
  ----
  
  
  --> The 'gColorList' created with monitor set to 8-bit (256 colors):
  put gColorList
  -- [#Gold: 161, #Orange: 38, #Orchid: 206]

  --> The same 'gColorList' created in 16-bit (thousand colors, Mac):
  put gColorList
  -- [#Gold: 6752, #Orange: 26611, #Orchid: 198]
  --
  --> color palette position 0 (Macintosh = white):
  -->  8-bit:        0
  --> 16-bit:    32767
  --> 32-bit: 16777215

  --> color palette position 5:
  -->  8-bit:     5
  --> 16-bit:   992
  --> 32-bit: 65280

  --> color palette position 254:
  -->  8-bit:     254
  --> 16-bit:   16384
  --> 32-bit: 8388608

  --> color palette position 255 (Macintosh = black):
  -->  8-bit: 255
  --> 16-bit:   0
  --> 32-bit:   0
  -->
  --> Understand the principle?  ;-)


  --> Usage:
  --
  set the BACKcolor of MEMBER fieldMember   = getColor(#Orchid)
  set the foreColor of char 1 of word 7 of  ¬
   item 2 of line 3 of MEMBER fieldMember   = getColor(#Gold)

  --> for 1-bit, button and shape sprites, use:
  set the FOREcolor of SPRITE channelNumber = getColor(#Orange)

  --> ...if this doesn't work for 1-bit or shapes, rewrite
  --> the 'repeat' loop in this handler to retrieve its color values
  --> from some (hidden) colored shape sprites on the stage:
  --> ...'set thisValue = the foreColor of sprite ii'...
  --
end getColor





[index] _ D5/601 _ 971212:


hilite

command for chunks of a field member

= The 6.0 Dictionary misses:
"See Also: ... the mouseItem, the selection"
 --

From the '501 ReadMe':
  Director uses hilighting colors depending on the movie's palette,
  and on the backcolor and the forecolor(s) of the chunk (part)
  of the field castMember that is being hilited.
  --

1. TIP: Although the 6.0 Dictionary states that the term 'field' is outdated and recommends to use 'member' instead, the 'hilite' command does NOT work with 'member': It still expects 'field nameOrNumber'.

2. TIP: Using 'hilite' for chunks of field members that have different colors will result in different hiliting colors, and some color combinations will not even produce a hiliting effect at all. Be aware of the effect of this command not being very reliable, and especially with a custom palette you can get uncharming results.

3. TIP: No stage update or puppet is needed when setting 'hilite' for chunks of a field MEMBER, because all SPRITE appearances of that field in your movie are updated immediately and will persist, and you CANNOT use a transition effect for the change. See 'field' for a workaround.

4. TIP: You can use 'the mouseLine' to hilite the line the mouse is over in a field, but remember: A single 'line' in a field is delimited by its ending RETURN, and NOT by its (word) wrapping in the field's sprite box on stage, so a single 'line' of text can break up into multiple visual lines on stage. Remember to take away any 'hilite' that you don't need anymore by setting it to an off-limit line of that field: 'hilite line 999 of field "MyField"'. Gretchen's 601 BugList mentions that left or center justified fields report the wrong 'mouseLine' if the user clicks on the blank space to the left of the text, between two lines. (Mac)

--

EXAMPLEs:

set thisLine = the mouseLine
set thisCast = the mouseCast
--
if (thisCast > 0) AND (the type of member thisCast = #field) then
  if (thisLine > 0) then
    hilite line (thisLine) of field (thisCast)
  else
    hilite line 999 of field (thisCast)
  end if
end if

--> In 6.0, use 'the mouseMember' instead of 'mouseCast',
--> and test 'if (thisCast > VOID)'...





[index] _ D5/601 _ 971212:


item...of

field member, chunk and string expression keyword

6.0 Dictionary Errors, partly the same in 5.0:

"...delimited by commas."
= Not enough; should read:
"...delimited by commas, or the character you set
    the 'itemDelimiter' property to (default is comma)."

"When the number that specifies the last item is greater..."
= Should read:
"When the number that specifies 'lastItem' is greater..."

= Missing:
"You can test but not set the 'item...of' keyword,
 you have to use 'put...into item...of'.
 You can also 'put...before' and 'put...after' it."

= Missing:
"If you test a single item at a position higher than
'the number of items in...', you get EMPTY ("").
 If you 'put...into' a single item at such an position,
 you create new (empty) items up to that position."

= Missing:
"See Also:...the mouseItem, the last item in, itemDelimiter,
 field, put...after/before/into, delete, hilite"
 --

From the '601 ReadMe':
  The 'number of items' now works when
  'the itemDelimiter' is set to lower-case 'c'.
  --

1. TIP: The chunk expressions 'item x of...' and 'item x to y of...' relate to a field castMember or a string variable, or a part of either. The Dictionary calls that 'chunks' or 'chunk expressions'.

2. TIP: An 'item' is delimited by Lingo's 'the itemDelimiter'; default is the comma (","), but it will never contain any itemDelimiter in its string when you retrieve it.

3. TIP: An 'item' can be of almost any length and include any white spaces, quotation marks, and RETURNs, and it WILL include all white spaces between its itemDelimiters before and after it.

4. TIP: To test how many items are in a chunk, use 'the number of items in chunkExpression', which returns the number of the last item. Use 'the last item of...' to see what's in that last item.

5. TIP: If you put EMPTY or "" into a single 'item', you still have an EMPTY item (""), together with its delimiting comma.

6. TIP: If you have an 'itemDelimiter' at the end of a chunk expression, it will produce one more EMPTY ("") item after it, and 'the number of items in chunkExpression' will increase by 1.

7. TIP: You can add strings together as items by putting '& the itemDelimiter &' between them.

8. TIP: You can test AND set text formattings and 'the foreColor' for chunks of field members, like 'the font of item 2 of line 5 of member whichFieldMember', but remember: Field manipulations are time consuming.

9. TIP: Test 'the mouseItem' to get the number of the item of a field sprite the mouse is over, the 'mouseItem' returns -1 if the cursor is not over ANY text item on stage, or if it is over some inappropriate part of a field like the border or scroll bar. If the mouse is over empty space beyond the last item in the field, 'the mouseItem' returns the number of the last item of that field. And remember: The 'mouseItem' reacts to the center of your cursor, and NOT to its 'regPoint' (its hot spot). Test 'the mouseCast' and 'the type of member (the mouseCast)' to see if and which field sprite the mouse is over. In 6.0, test 'the mouseMember', which returns VOID if over no sprite.

10. TIP: If you test or 'put...into' item -1 or 0, you will get or change the entire chunk expression.

11. TIP: If you test item 99, and 99 is higher than 'the number of items in chunkExpression', you will get an EMPTY string (""). If you 'put...into' item 99 in this case, you'll automatically create EMPTY items up to 99, delimited by the 'itemDelimiter' (default is the comma), so you will get a bunch of commas before item 99.

12. TIP: You can retrieve and delete 'the last item of chunkExpression', but you CANNOT 'put...into' this expression. If you want to change the last item, use: 'put...into item (the number of items in chunkExpression) of chunkExpression'.

13. TIP: To change item x:
'put (someStringOrEMPTY) into item x of chunkExpression'

14. TIP: To add a new item before item x:
'put (someStringOrEMPTY & the itemDelimiter) before item x of chunkExpression'.

15. TIP: To add a new item after item x:
'put (the itemDelimiter & someStringOrEMPTY) after item x of chunkExpression'.

16. TIP: To delete item x together with its itemDelimiter:
'delete item x of chunkExpression'.

17. TIP: Set 'the itemDelimiter' property to any char you want to define for separating items, example: to separate name items in a 'pathName' or 'moviePath' string, set the itemDelimiter to "\" (or to "/" or ":"). Best to turn it back to the default (",") or to a pre-defined variable when done. Remember: Items can include lines and be very big, so by using a very special char like '>' or '<' as 'the itemDelimiter', you can store a lot of text and even HTML chunks in items (ie when using Shockwave).

18. TIP: You CANNOT test or set 'item x of myLinearList', because a linear list ([ ]) is a 'value expression', not a string expression, although the Dictionary sometimes speaks of 'items' in (linear or property) lists. Creating items in a string variable or in a text field has the advantage over list variables ([ ]), that no ending character is needed, so this string list CANNOT be broken. Also you can easily write a string list to a file without any conversion problems.

--

EXAMPLEs:

put item 1 of EMPTY
-- ""
set x = "1,2,3,4,5"
--
put item -1 of x
-- "1,2,3,4,5"
put item  0 of x
-- "1,2,3,4,5"
put item  1 of x
-- "1"
put item  5 of x
-- "5"
put item  6 of x
-- ""

put item  4 to 7 of (x & the itemDelimiter & "6,7,8,9,10")
-- "4,5,6,7"
delete item 2 to 4 of x
put x
-- "1,5"

put EMPTY into item 1 of x
put x
-- ",5"
put the number of items in x
-- 2

put (item 1 of x = "")
-- 1





[index] _ D5/601 _ 971212:


line...of

field member, chunk and string expression keyword

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"You can test but not set the 'line...of' keyword,
 you have to use 'put...into line...of'.
 You can also 'put...before' and 'put...after' it."

= Missing:
"If you test a single line at a position higher than
'the number of lines in...', you get EMPTY ("").
 If you 'put...into' a single line at such an position,
 you create new (empty) lines up to that position,
 delimited by RETURNs."

= Missing:
"See Also: ... the mouseLine, the last line in, the number
 of lines in, field, put...after/before/into, delete, hilite"
 --

1. TIP: The chunk expressions 'line x of...' and 'line x to y of...' relate to a field castMember or a string variable, or a part of either. The Dictionary calls that 'chunks' or 'chunk expressions'.

2. TIP: A 'line' is delimited by a RETURN = numToChar(13), but it will never contain any RETURN in its string when you retrieve it. If you want to determine how many wrapped lines of a field member are visible in its sprite box on stage, when its 'wordWrap' is turned on, use the new property 'the lineCount of member'.

3. TIP: A 'line' can be of almost any length and include any white spaces, quotation marks, and punctuation. Remember: If you import text files on Windows, TWO characters are used for line breaks: RETURN + numToChar(10). When you port such richText or field members to the Macintosh, the 'Line Feed' character numToChar(10) will be shown as a box at the beginning of the next line and not belong to the line it's supposed to end.

4. TIP: To test how many lines are in a chunk, use 'the number of lines in chunkExpression', which returns the number of the last line. Use 'the last line of...' to see what's in that last line.

5. TIP: If you put EMPTY or "" into a single 'line', you still have an EMPTY line (""), and also its delimiting RETURN.

6. TIP: If you have a RETURN at the end of a chunk expression, it will produce one more EMPTY line after it, and 'the number of lines in chunkExpression' will increase by 1.

7. TIP: You can add strings together as lines by putting '& RETURN &' between them.

8. TIP: You can test AND set text formattings and 'the foreColor' for chunks of field members, like 'the font of line 3 of item 8 of member whichFieldMember', but remember: Field manipulations are time consuming.

9. TIP: Test 'the mouseLine' to get the number of the line of a field sprite the mouse is over, the 'mouseLine' returns -1 if the cursor is not over ANY line on stage, or if it is over some inappropriate part of a field like the border or scroll bar. If the mouse is over empty space beyond the last line in the field, 'the mouseLine' returns the number of the last line of that field. And remember: The 'mouseLine' reacts to the center of your cursor, and NOT to its 'regPoint' (its hot spot). Test 'the mouseCast' and 'the type of member (the mouseCast)' to see if and which field sprite the mouse is over. In 6.0, test 'the mouseMember', which returns VOID if over no sprite.

10. TIP: If you test or 'put...into' line -1 or 0, you will get or change the entire chunk expression.

11. TIP: If you test line 99, and 99 is higher than 'the number of lines in chunkExpression', you'll get an EMPTY string (""). If you 'put...into' line 99 in this case, you'll automatically create EMPTY lines up to 99, delimited by RETURNs.

12. TIP: You can retrieve and delete 'the last line of chunkExpression', but you CANNOT 'put...into' this expression. If you want to change the last line, use: 'put...into line (the number of lines in chunkExpression) of chunkExpression'.

13. TIP: To change line x:
'put (someStringOrEMPTY) into line x of chunkExpression'

14. TIP: To add a new line before line x:
'put (someStringOrEMPTY & RETURN) before line x of chunkExpression'.

15. TIP: To add a new line after line x:
'put (RETURN & someStringOrEMPTY) after line x of chunkExpression'.

16. TIP: To delete line x together with its RETURN:
'delete line x of chunkExpression'.

17. TIP: Remember: A single 'line' in a field is delimited by its ending RETURN, and NOT by its (word) wrapping in the field's sprite box on stage, so a single 'line' of text can break up into multiple visual lines on stage.

18. TIP: On Windows, texts normally use an additional char after the carriage RETURN (numToChar(13)): the 'Line Feed' char (ASCII 10), which can be tested and set by using 'numToChar(10)'. When you write out text with Director's 'FileIO' Xtra or Xobject, you can create you own (global) RETURN variable 'gRETURN' for Macintosh and Windows by using: 'global gRETURN .. set gRETURN = RETURN .. if (the machineType = 256) then put numToChar(10) after gRETURN'.
When ported to Macintosh, the 'Line Feed' char of Windows will be seen as a non-alphanumeric square at the beginning of the next line, and as it belongs to that line it won't be copied together with the line it's supposed to end. To get rid of this 'Line Feed' char on Macintosh, use 'set x = the number of lines in chunkExpression .. repeat with ii = 1 to x .. if (char 1 of line ii of chunkExpression = numToChar(10)) then delete char 1 of line ii of chunkExpression..end repeat'. To save time, it's best to copy text out of a field into a variable before working on it, and back into the field when finished.

--

EXAMPLEs:

put line 1 of EMPTY
-- ""
--
set x = ("Hi," & RETURN & "I'm Denis.")
put x
-- "Hi,
I'm Denis."
--
put line -1 of x
-- "Hi,
I'm Denis."
put line  0 of x
-- "Hi,
I'm Denis."
put line  1 of x
-- "Hi,"
put line  2 of x
-- "I'm Denis."
put line  3 of x
-- ""
--
put ("nice to meet you." & RETURN) before line 2 of x
put x
-- "Hi,
nice to meet you.
I'm Denis."
--
put (RETURN & "How are you?") after line 2 of x
-- "Hi,
nice to meet you.
How are you?
I'm Denis."
--
set x = "ASCII 10: hidden in Windows," & RETURN
set x = x & numToChar(10) && "visible on Macintosh."
put x
-- "ASCII 10: hidden in Windows,
! visible on Macintosh."
--
--> ...but the first ASCII letter on the above line
--> will not display properly in this context (should be a box).
--
put (char 1 of line 2 of x = numToChar(10) )
-- 1





[index] _ D5/601 _ 971212:


lineHeight()

field member line spacing function

1. TIP: The 'lineHeight()' function can be used to test, but NOT to set a line spacing size.

2. TIP: Instead of using 'lineHeight(member whichFieldMember, lineNumber)', you can also use 'the lineHeight of line lineNumber of member whichFieldMember': Both return the same value for a single line.

3. TIP: Remember: A single 'line' in a field is delimited by its ending RETURN, and NOT by its (word) wrapping in the field's sprite box on stage; so a single 'line' of text can break up into multiple visual lines on stage. If you want to determine how many wrapped lines of a field member are visible in its sprite box on stage when its 'wordWrap' is turned on, use the new command 'the lineCount of member'.

4. TIP: Remember: The value for 'lineHeight()' is NOT equal to the value that 'the fontSize of line' indicates for a given line: 'lineHeight()' returns the size of the used font PLUS the additional pixels of white space between the lines.

5. TIP: For examples, see 'lineHeight of member'.






[index] _ D5/601 _ 971212:


lineHeight of member

text property of field members and chunks of them

6.0 Dictionary Errors, same in 5.0:

"...determines the line spacing...field cast member."
= Not enough; should read:
"When tested, it returns the line spacing of the FIRST LINE
 of the field castMember or the chunk in it. This property
 can also be used to test and set chunks of a field.
 Custom 'lineHeight' values do not combine well
 with scrolling fields on Windows."

= Missing:
"See Also: ... lineHeight() function, the number of lines in,
 the last line in, line...of, the mouseLine, field,
 backColor of member, foreColor of member"
 --

From the '601 ReadMe':
  Setting the 'font of member' or the 'fontSize of member' for
  field castMembers created through Lingo now works properly.
= Missing: I guess this applies also to 'lineHeight of member'.
  --

1. TIP: You can test AND set 'the lineHeight' of a single line of a field or chunk of it, but if you change it, it will show on stage, but NOT in Lingo or in Director's Field window, and it will NOT persist across sessions.

2. TIP: When you test a field or chunk of it, the 'lineHeight of member' only returns the line spacing in pixels of the FIRST LINE in it. Remember: It's very time consuming to test or set any properties of text in a field.

3. TIP: No stage update or puppet is needed when changing 'the lineHeight' of a field or chunk of it, because all SPRITE appearances of that MEMBER in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. See 'field' for a workaround.

4. TIP: Remember: A single 'line' in a field is delimited by its ending RETURN, and NOT by its (word) wrapping in the field's sprite box on stage, so a single 'line' of text can break up into multiple visual lines on stage. If you want to determine how many wrapped lines of a field member are visible in its sprite box on stage, when its 'wordWrap' is turned on, use the new command 'the lineCount of member'.

5. TIP: Remember: The value for 'the lineHeight' is NOT equal to the value that 'the fontSize' indicates for a field or chunk of it: the 'lineHeight' is the size of the used font plus the additional pixels of white space between the lines.

--

EXAMPLEs:

A field "MyField" with a couple of separate lines of text and a font size of 9 will have the following values before and after changing the 'lineHeight' property of the second line in it (on Macintosh). It will be set to the new value of '15', and it will show that new setting on stage, but NOT in Lingo or in Director's Field window, but only as long as the movie is playing:
put the   fontSize of member "MyField"
-- 9
put the lineHeight of member "MyField"
-- 12
put the   fontSize of line 2 of member "MyField"
-- 9
put the lineHeight of line 2 of member "MyField"
-- 12
set the lineHeight of line 2 of member "MyField" = 15
put the lineHeight of line 2 of member "MyField"
-- 12
--
put (15 = lineHeight(member "MyField", 2) )
-- 0





[index] _ 601 in 1/97:


margin

field member property

1. TIP: You CANNOT test or set 'the margin' of single chunks of a field, as this property belongs to the field member as whole.

2. TIP: No stage update or puppet is needed when changing 'the margin' of a field, because all SPRITE appearances of that MEMBER in your movie update immediately and persistently, and you CANNOT use a transition effect for the change, but remember: All sprite appearances will adjust their sizes to the new field size! And all changes to a field will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.

3. TIP: 5.0: When you 'set the margin of member', it changes the size of a fixed-size field on stage. It definitely does that when you change it during author-time using the 'Borders' dialog box on stage: The sprite's width will increase by twice the number of pixels you set the margin to, and its length will increase by approximately the size of the margin.






[index] _ D5/601 _ 971212:


scrollByLine(member)

field text display command

6.0 Dictionary Error, same in 5.0:

'This statement scrolls...up five lines:'
= Example 2 should read:
'This statement scrolls...up ONE line:
 scrollByLine(member "Today's News", -1)'

= Missing:
"See Also: scrollByPage(), the number of lines in,
 the last line in, line...of, the mouseLine, field"
 --






[index] _ 601 in 1/97:


scrollByPage(member)

field text display command

TIP: According to Gretchen's 501 BugList, if you scroll backwards by page in a field using 'scrollByPage member whichMember, -1', the field will actually scroll backwards a page length PLUS 1 line (at least on Macintosh).






[index] _ 601 in 1/97:


scrollTop

field and richText member display command

1. TIP: You can test AND set 'the scrollTop of member', its default is 0 if the field or richText is displaying its first word on stage. Remember to place the text cursor right at the beginning of a scrolling field during author-time, to ensure it will display its first word when on stage. And also remember to 'set the scrollTop = 0' for a scrolling field or richText, before bringing it on stage, as the user (or the author) might have scrolled it before.

2. TIP: You can also use negative values for 'the scrollTop of member' to have it scroll back down.






[index] _ 601 in 1/97:


selection

editable field member property

1. TIP: You can test, but NOT set 'the selection'. But you can create your own selection by setting 'the selStart' and the 'selEnd' of an editable field.

2. TIP: Before the user has clicked into any editable field on stage, 'the selection' defaults to FALSE (0), but once clicked, if will return an EMPTY string (""). Take this into consideration when testing 'the selection' repeatedly.

3. TIP: Remember: An editable field loses 'the selection' as soon as any other window is clicked.

4. TIP: This function (or is it actually a property?) does not work the way it should: Sometimes 'the selection' returns an additional (null) character inside the selected portion of the focused editable field.
Workaround:

if (the selStart <> the selEnd) then
  set myField     = the member of sprite (the clickOn)
  set mySelection = char (the selStart to the selEnd) of member (myField)
end if





[index] _ 601 in 1/97:


selEnd

editable field property

1. TIP: The 'selEnd' defaults to 0 only until the user clicks into any editable field on stage, and as long as the text cursor of an editable field on stage is placed right at the BEGINNING of the field (by the developer during author-time).

2. TIP: When you edit a field during author-time, remember to place the text cursor in front of the first char of the field when you're done (or wherever you want the text cursor and 'the selStart' and 'the selEnd' to stand), to ensure the display of the text later on on stage right from its beginning; forgetting this in a (scrolling) field won't display its first text line on stage!

3. TIP: To place the text cursor at the end of an active editable field with Lingo, use this workaround from Gretchen's 501 BugList: set 'the selStart' to 2 after and 'the selEnd' to 1 after the value of 'length(member whichFieldMember)'. To set the text cursor to the beginning of a field, set both to -1.

--

EXAMPLEs:

The following will place the text cursor at the end of the editable field "MyField", containing the Text "Hello World!", when it's focused on stage:
put field "MyField"
-- "Hello World!"
--
set    myField = field "MyField"
set textLength = length(myField)
put textLength
-- 12
--
set the selStart = textLength + 2
set the selEnd   = textLength + 1
--
put (the selection = EMPTY)
-- 1





[index] _ 601 in 1/97:


selStart

editable field property

TIP: See 'selEnd'.






[index] _ D5/601 _ 971212:


word...of

field member, chunk and string expression keyword

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"You can test but not set the 'word...of' keyword,
 you have to use 'put...into word...of'.
 You can also 'put...before' and 'put...after' it."

= Missing:
"If you test a single word at a position higher than
'the number of words in...', you get EMPTY ("").
 If you 'put...into' a single word at such an position,
 you just attach the new string after the last word,
 without a space inbetween."

= Missing:
"See Also: ... the mouseWord, the last word in,
 field, put...after/before/into, delete, hilite"
 --

1. TIP: The chunk expressions 'word x of...' and 'word x to y of...' relate to a field castMember or a string variable, or a part of either. The Dictionary calls that 'chunks' or 'chunk expressions'.

2. TIP: A 'word' is delimited by white spaces, a TAB, or a RETURN, but it will never contain any white spaces in its string when you retrieve it.

3. TIP: A 'word' can be of almost any length and will include any punctuation (comma, dot, colon, &, quotation marks, etc). A 'word' CANNOT include a RETURN, because that's considered a white space.

4. TIP: To test how many words are in a chunk, use 'the number of words in chunkExpression', which returns the number of the last word. Use 'the last word of...' to see what's in that last word.

5. TIP: If you put EMPTY or "" into a single 'word', you delete that word and 'the number of words in chunkExpression' will be 1 less, but you keep one additional white space (" ") left over at that position.

6. TIP: If you have two or more white spaces anywhere inside or at the end of a chunk expression, they will NOT be considered as EMPTY words. Remember: A trailing comma or dot will be part of the word in front of it, and when using 'word...of' make sure that your text or string is correctly written and that all words and sentences are delimited by white spaces or a RETURN.

7. TIP: You can add strings together as words by putting an empty space '&&' (or: & quot; " &) between them.

8. TIP: You can test AND set text formattings and 'the foreColor' for chunks of fields, like 'the font of word 1 of line 2 of member whichFieldMember', but remember: Field manipulations are time consuming.

9. TIP: Test 'the mouseWord' to get the number of the word of a field sprite the mouse is over, the 'mouseWord' returns -1 if the cursor is not over ANY word on stage, or if it is over some inappropriate part of a field like the border or scroll bar. If the mouse is over empty space beyond the last word in the field, 'the mouseWord' returns the number of the last word of that field. And remember: The 'mouseWord' reacts to the center of your cursor, and NOT to its 'regPoint' (its hot spot). Test 'the mouseCast' and 'the type of member (the mouseCast)' to see if and which field sprite the mouse is over. In 6.0, test 'the mouseMember', which returns VOID if over no sprite.

10. TIP: If you test or 'put...into' word -1 or 0, you will get or change the entire chunk expression.

11. TIP: If you test word 99, and 99 is higher than 'the number of words in chunkExpression', you'll get an EMPTY string (""). If you 'put...into' word 99 in this case, you'll attach the new content right at the end of the chunkExpression without a space before it.

12. TIP: You can retrieve and delete 'the last word of chunkExpression', but you CANNOT 'put...into' this expression. If you want to change the last word, use: 'put...into word (the number of words in chunkExpression) of chunkExpression'.

13. TIP: To change word x:
'put (someString) into word x of chunkExpression'

14. TIP: To add a new word before word x:
'put (someString &&) before word x of chunkExpression'.

15. TIP: To add a new word after word x:
'put (&& someString) after word x of chunkExpression'.

16. TIP: To delete word x together with its white space:
'delete word x of chunkExpression'.

--

EXAMPLEs:

put word 1 of EMPTY
-- ""
--
set x = "Hi, I'm Denis."
--
put word -1 of x
-- "Hi, I'm Denis."
put word  0 of x
-- "Hi, I'm Denis."
put word  1 of x
-- "Hi,"
put word  2 of x
-- "I'm"
put word  3 of x
-- "Denis."
put word  4 of x
-- ""

put word  3 to 5 of (x && "How are you?")
-- "Denis. How are"

delete word 2 of x
put x
-- "Hi, Denis."

put EMPTY into word 1 of x
put x
-- " Denis."

put the number of words in x
-- 1
put word 1 of x
-- "Denis."





[index] _ 601 in 1/97:


wordWrap

field member property

1. TIP: You can test AND set 'the wordWrap of member', it reflects the setting in the 'Cast Members Properties' dialog box of a field member, and its default is TRUE. If you create a new empty field member from Director's 'Insert - Control - Field' menu, it will automatically have its property 'Word Wrap' set to TRUE.

2. TIP: No stage update or puppet is needed when changing 'the wordWrap' of a field MEMBER, because all SPRITE appearances of that field in your movie update immediately and persistently, and you CANNOT use a transition effect for the change. All text or property changes to a field member will be saved with your movie, unless you reset them manually or in your 'on stopMovie' handler.

3. TIP: You CANNOT test or set 'the wordWrap' of single chunks of a field member, as this property belongs to the field member as whole.

4. TIP: If you want to determine how many wrapped lines of a field member are visible in its sprite box on stage, when its 'wordWrap' is turned on, use the new command 'the lineCount of member'.

5. TIP: If you turn the default 'wordWrap' setting of a field member off by setting it to FALSE, each single line (delimited by a RETURN) will only occupy 1 line in your field. If a line doesn't fit into the field's sprite box on stage, it will flow under the right sprite border and its remainder will be invisible. But this can be an advantage when a field on stage serves as a kind of menu, from which the user can choose one entry from multiple item lines, which you can test with 'the mouseLine'. If you want to use the 'hilite' command for a whole line in such a menu, add enough white spaces after the item to make the line disappear under the right field border, so the hilite will cover the whole width of the sprite box. You can even hide Lingo information invisibly at the end of the lines this way, like the name of the handler to be executed, or an index number, etc. You can then retrieve this last word at the end of the line with 'set x = the last word of line (the mouseLine) of field (the mouseCast)'. For more info, see 'line...of' and 'word...of'.

6. TIP: There have been many problem reports on the fact that Director 5.0 breaks up and wraps words that include umlaute (ä,Ä,ö,Ö, etc) or accented characters. I think that some problems persist in 501, at least on Windows 3.1, and possibly only for updated Director 4 movies. Remember: Accented and other special characters do not all get translated correctly when ported from the Macintosh to the Windows System, even if you use Directors FONTMAP.TXT in the 'Movie Properties' dialog box. You might have to exchange each single appearance of any problematic character in your project's fields manually during author-time. (Imagine: In 1996, we finished a travel guide on CD-ROM, including hundreds of Hungarian words and names, uuh, many problem chars... ;)). And Rob Dillon at www.ddg-designs.com mentions that Director does not remap text that is in buttons (created with Director's Tool Palette window); in 6.0, the new Button Editor property 'the labelString of member' is turned into an anti-aliased bitmap).





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_Fields.html"  (971218)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de
 Top