FutureBasic Logo

<<    Index    >> FutureBasic 5

edit$   function



Syntax:
fieldContents$|container$$ = edit$(fieldID)
fieldContents$|container$$ = edit$(fieldID, lineNumber)
fieldContents$|container$$ = edit$(fieldID, -1)
fieldContents$|container$$ = edit$(fieldID, selStart ,selEnd)


Description:
This function returns the contents of the specified edit field in the current output window. If the edit field contains more than 255 characters of text and a string is specified to receive the information, then only the first 255 characters are returned. Where a container is the specified target, there is more than enough room to hold the contents of a field. Use the get field statement if you need to retrieve style information along with the text of a styled edit field.
If a single parameter is used, the edit$ function attempts to return as much of the entire edit field as will fit into the target variable.
If a second parameter of -1 is added, the function returns the current selection in whole or part depending on the size of the target variable. A second parameter that consists of a numeric value specifies the line number that is to be returned.
Where three parameters are used, the second and third values are used to specify the starting and ending points of text to be captured. If the target variable is a string instead of a container, no more that 255 bytes of information can be returned.
In all cases, FutureBasic ensures that variables are not overflowed. This is important because we are working with three different sizes of items here.
Item
Size
Pascal String
255 bytes + length byte
Edit Field
32,767 bytes
Container
2 gigabytes
If fieldID refers to a picture field, then the edit$ function returns the pictID$ string that was specified in the picture field statement. You can use this to identify the handle or resource that contains the picture.
If there is no edit field nor picture field with an ID of fieldID in the current output window, the edit$ function returns a null string.

See Also:
edit field; edit$ statement; window(_efNum)