text:
Futurebasic/Language/Reference/appearance window

Statement
✔ Appearance χ Standard χ Console

Syntax
appearance window [#][-] id&[, [title$][, [rect][, ¬ [windowClass][, [windowAttributes] [, [FBAttributes]]]]]]

Revised
Feb 2002 (Release 6)

Description
Use this statement to do any of the following:  Create a new screen window; Activate (highlight and bring to the front) an existing window; Make an existing window visible or invisible; Alter the title or rectangle of an existing window.

The  statement closely follows the older   statement, but is used primarily for the creation of windows. You may freely mix  functions and   statements with windows that are created via the   statement. For instance, after creating a window with the  statement, you could determine its size with the   and   functions.

You may notice that windows in most modern applications have a background that is something other than white. This is not accomplished by drawing into the window with graphic commands. It is put in place with a simple call to the Theme Manager. The following line will be useful in many programs. def SetWindowBackground( _kThemeActiveDialogBackgroundBrush, _zTrue ) The parameters for  should be specified as follows. They are interpreted slightly differently depending on whether you are creating a new window or altering an existing one.  - a positive or negative integer whose absolute value is in the range 1 through 2147483647. - a string expression. - a rectangle in global screen coordinates. You can express it in either of two forms:

Two diagonally opposite corner points. Long integer expression or  variable which points to an 8-byte struct such as a   type   - an unsigned long integer that specifies the Macintosh window class. This is not the same value as FB's user definable class for the standard runtime. It more closely represents the layer in which a window will reside. To create a  variable use the following syntax: dim wc as WindowClass The  table introduces some new terms which may not be familiar to those new to OS X. A sheet window is attached to a parent window. It drops from the title bar of the parent and is used to force some decision relative to the parent window.

1     I need your attention now. 2     I need your attention now, but I'm kind enough to let you switch out of this app to do other things 3     system modal, not draggable 4     application modal, draggable 5     floats above all other application windows. Available in OS 8.6 or later 6     document windows 7     the desktop 10     help windows 11     sheets 12     floats above docs, below floating windows 13     plain 14     overlays 15     sheet alerts 16     plain alerts

  - this long integer sets up handling procedures that are used by the runtime. Some of the features used in the Standard BASIC runtime are not carried forward for the Appearance Runtime. For example,  is not used because there is no such thing as   in Appearance.

2048    This attribute affects how the window’s clip region will be set when FutureBASIC calls your dialog-event handling routine with a   event. If you specify this attribute, the clip region will be set to include only that part of the window which was identified as actually needing a refresh (the clip region will be reset to its previous value when the routine exits). If you omit this attribute, the clip region will be set to include the entire window (possibly excluding controls, edit fields, etc.) 4096    This attribute affects what happens when your program activates the window in response to a   event. If the  attribute is set, the activating click will be “passed through” to the window; this may cause other events (such as   or  ) to be generated, depending on what was clicked on. If you omit this attribute, two separate clicks are required to activate the window and to interact with its contents. 32768    Use this attribute to prevent the tab key from advancing the keyboard focus in edit fields 65536    This attributes insures that the window will never be activated. Controls in the window will not function If you bring the window forward under program control ( statement) it will behave normally. This type of window is intended for use as a backdrop.

To Create a New Screen Window
 Specify an  value such that   is different from the ID number of any existing window. A new window is created and is assigned an ID number of. You can use the window's ID number later to identify the window in other FB statements and functions. If  is negative, the window is created invisibly; it's sometimes useful to create a window invisibly if it will contain controls, edit fields and graphics that may take a long time to build. You can use the  statement again to make an invisible window visible (see below). When you create a new window, it becomes the current output window. If you create it visibly (and you don't specify the  attribute), it also becomes the current active window. assigns a string to the window's title bar (if the window has a title bar). If you omit this parameter, the window will be created without a title. specifies the initial size and location of the window's content rectangle. Note that  does not include the window's frame. This parameter is interpreted in a special way if you specify an upper-left coordinate of (0,0) in ; in this case, the window is centered in the screen, and its width and height are determined by the right and bottom coordinates of. Note that this special interpretation applies only when you're creating a new window. If you omit this parameter, a window of a "default" size and location is created.
 specifies the layer in which a window will reside.
 specifies the types of window widgets (close box, grow box) that a window will include.
 specifies runtime handling parameters that determine how the window will behave.


text:
Futurebasic/Language/Reference/append

Statement
✔ Appearance ✔ Standard ✔ Console

Syntax
append [#]fileID

Description
This statement moves the file mark, in the currently-open file indicated by, to the end-of-file position (without overwriting any of the existing data in the file). This causes subsequent file output statements such as,   and   to append data to the end of the file.

Example
In the following, note that we open the output file using the "R" method. This is because opening with the "O" method causes the "end-of-file" mark to move to the beginning of the file, effectively erasing any existing data. a$ = "TESTING..." open "R", 1, fileName$,, wdRefNum% 'Open an existing file append #1                         'Set file pointer to end write #1, a$;25                   'Add data to end of file close #1                          'Close file

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Futurebasic/Language/Reference/append


text:
Futurebasic/Language/Reference/apple menu

Statement
✔ Appearance ✔ Standard χ Console

Syntax
apple menu string$

Description
This statement inserts one or more items at the top of the Apple Menu, and separates them from the existing Apple Menu items with a grey dividing line. The items you add are visible only while your application is frontmost. The  parameter contains the text of the item(s); to add multiple items, separate them with semicolons in. Certain "meta characters" in  have special interpretations; see the   statement for more information.

After you add items to the Apple Menu, you can use the  function to detect when the user selects one of the items you've added.

If you execute  more than once, any items you added to the Apple Menu previously will be completely replaced.

Example
apple menu "About this program...;About Me..."


text:
Futurebasic/Language/Reference/appleeventmessage

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
string$ = AppleEventMessage$

Revised
May, 2001 (Release 5)

Description
When your application (also referred to as your process) receives an Apple Event message and the event class is, FB will retrieve the event data as a Pascal string when this function is invoked.


text:
Futurebasic/Language/Reference/asc

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
ASCIIcode% = asc( string$ ) ASCIIcode% = asc( container$$ )

Revised
July 28, 2000 (Release 3)

Description
Returns the ASCII character code for the first character in  or. (A character code is a numeric value in the range of 0 through 255 that represents a specific character in the American Standard Code for Information Interchange (ASCII).) If  (or  ) contains no characters, then   returns zero.

The ASCII character codes between 32 and 127 represent standard characters which generally remain the same from one font family to another. Codes greater than 127 represent different sets of characters depending on the font. Codes below 32 usually represent non-printing "characters."

title: Futurebasic/Language/Reference/asc


text:
Futurebasic/Language/Reference/asin

Function
✔ Appearance ✔  Standard ✔  Console

Syntax
radianAngle# = asin( expr )

Description
Returns the arcsine of  in radians. In other words, if  represents the sine of some angle, then      returns the angle. The returned angle will be in the range of -π/2 to +π/2 radians (which corresponds to -90 to +90 degrees). always returns a double-precision result.

title: Futurebasic/Language/Reference/asin


text:
Futurebasic/Language/Reference/asinh

Function
✔ Appearance ✔  Standard ✔  Console

Syntax
result# = asinh( expr )

Description
Returns the inverse hyperbolic sine of. This is the inverse of the  function, so that    equals. always returns a double-precision result.

title: Futurebasic/Language/Reference/asinh


text:
Futurebasic/Language/Reference/atan

Function
✔ Appearance ✔  Standard ✔  Console

Syntax
radianAngle# = atan( expr )

Description
is a synonym for the  function.

title: Futurebasic/Language/Reference/atan


text:
Futurebasic/Language/Reference/atanh

Function
✔ Appearance ✔ Standard ✔  Console

Syntax
result# = atanh( expr )

Description
Returns the inverse hyperbolic tangent of. This is the inverse of the  function, so that    equals. always returns a double-precision result.

title: Futurebasic/Language/Reference/atanh


text:
Futurebasic/Language/Reference/atn

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
radianAngle# = atn( expr )

Description
Returns the arctangent of  in radians. In other words, if  represents the tangent of some angle, then      returns the angle. The returned angle will be in the range of -π/2 to +π/2 radians (which corresponds to -90 to +90 degrees). always returns a double-precision result.

Example
Because   equals π/4, you can use   to get a value for π. dim pi# end globals

pi = atn( 1 ) * 4 print pi Program output: 3.14159265359

title: Futurebasic/Language/Reference/atn


text:
User:Meesh~enwikibooks

== hi my name is meesh and i am 100 years old i am a chick magnet i have no hair and my skin color is green and my language is spanish so just send a message to my page and we could talk about what we like

title: User:Meesh~enwikibooks


text:
User:Skyc

Undergrad Math and CS major currently taking Intro to Real Analysis. Working on the Set Theory book.

title: User:Skyc


text:
User talk:Meesh~enwikibooks

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. --AdRiley (talk) 07:34, 1 February 2008 (UTC)

Your User page
Hello Meesh, welcome to wikibooks but do you think you could remove the message on your user page please? It's really really appropriate for wikibook. Thanks --AdRiley (talk) 07:34, 1 February 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Meesh. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Meesh~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:29, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:15, 19 April 2015 (UTC)

title: User talk:Meesh~enwikibooks


text:
User talk:Jaqweesss

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 07:37, 1 February 2008 (UTC)

title: User talk:Jaqweesss


text:
User talk:Macaddict~enwikibooks

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 07:41, 1 February 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Macaddict. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Macaddict~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:23, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:13, 19 April 2015 (UTC)

title: User talk:Macaddict~enwikibooks


text:
User talk:AmyJ~enwikibooks

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 07:44, 1 February 2008 (UTC)

Signing your name
Welcome to Wikibooks Amy. Did you know you can sign your name by typing --~. --AdRiley (talk) 07:44, 1 February 2008 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called AmyJ. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name AmyJ~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 22:57, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:31, 19 April 2015 (UTC)

title: User talk:AmyJ~enwikibooks


text:
User:Jre~enwikibooks

Current reading list
LaTeX
 * LaTeX/Bibliography Management

title: User:Jre~enwikibooks


text:
Topfield 5800/Troubleshooting/EPG Gaps

EPG Missing Data or Gaps
Data is completely missing on certain channels

Data is running out or has run out on certain channels (firmwares before 5.12.88)

Data seems to run out or become sparse after being on for a long time

Lots of gaps soon after starting up

title: Topfield 5800/Troubleshooting/EPG Gaps


text:
Topfield 5800/Troubleshooting/Freeview Shuffle

Occasionally the way the Freeview channels are organised is shuffled about a bit. Sometimes new channels are added, some stop broadcasting, there are name changes, or things are just moved about for technical reasons. This shuffling can sometimes confuse the Toppy (and other Freeview receivers) with symptoms such as missing EPG data or the wrong channel being displayed.

To remedy this you will need to do a rescan to get the correct channel list. If just a few channels are affected then you may be able to simply delete the old channels and scan for the new ones, but it's usually safest to do a Factory Reset (which will also delete all your current timers) and then a complete rescan.

If you are running an older firmware (pre-"Bastille", 5.12.88) then the EPG data for some channels may be missing because the specific broadcaster is having a bad day and is not sending it (or transmitter problems or maintenance). This is much less likely to be a problem on newer firmwares which can collect all the EPG data from any single channel.


text:
User talk:Rundquist

G'day, thanks for spotting the errors on Cookbook:Sheik el Mahshi and Cookbook:Warak Dawali. I'm now deleting both, as they have never had recipes other than the duplicates of Garlic Lemon Chicken. Bugger! Again, thanks for spotting it. Webaware talk 12:43, 1 February 2008 (UTC)

title: User talk:Rundquist


text:
User:Volfgang

jawp

enwt | enwn

ja:利用者:Volfgang

title: User:Volfgang


text: User talk:167.206.128.199

title: User talk:167.206.128.199


text:
User talk:131.123.184.65

You have been warned

 * Edits were made by this IP earlier in the day - please see contributions for details. Thanks -- Herby  talk thyme 19:05, 1 February 2008 (UTC)

title: User talk:131.123.184.65


text:
User:Whiteknight/New Book Guide/Design Patterns

Design Patterns
Developing books do not emerge fully-formed and in a perfect book shape. The process for creating a book can cause a book to take many forms which are not in themselves acceptable here at Wikibooks. However, so long as progress is continuous, various stages of books can not only be accepted here in the short-term, but also can be beneficial tools to book authors.

Books are large projects, and it is generally not conceivable that an author will be able to write, to completion, one page at a time in a linear fashion. In fact, it should be assumed that most authors are only transient members here at Wikibooks, and that they could abandon their work here at any time.

With this in mind, an author who wants to see their books succeed in the long-term should develop their book while attempting to maximize the ability for future authors to take over if the original author should leave suddenly. Books should start as a clear plan, such as a pagelist or an outline. From the outline, a page should progress to one of several intermediate forms. These intermediate forms allow a book to increase in size and information content rapidly, without needing to worry extensively about organization or formatting. After a book has expanded significantly in one of these intermediate forms, editors, revisers, and reviewers can polish the book to make it better and eventually make it a featured book. The general design pattern for a book that allows other authors to quickly and easily pick up where the original author left off is:

Outline → Intermediate Form → Book → Featured Book

Warning About Intermediate Forms
Notice that intermediate forms are not considered stable books. If a book in an intermediate form is long abandoned, it runs a high risk of being deleted. Stubs are relatively well tolerated on Wikibooks, and a large portion of our community will resist deleting them unless they are in particularly bad shape. Macropedias are against policy, and unless a transwiki will significantly improve content at Wikipedia (which is unlikely), macropedias can be quickly deleted. This is a case that is counter-intuitive: Where a book in notably better condition (a macropedia) can be deleted easier than a book in worse condition (a stub). Course-like books are better-tolerated than macropedias are, but they still run the risk of being transwikied to Wikiversity if you don't pay close attention to them.

Outlines
Outlines are not necessarily stubs because they do not need to contain any content. Outlines are a great way to plan and prepare a book, but a free-standing outline that has been long-abandoned by it's original authors are generally not helpful or valuable. In fact, they can be counter-productive because they set up a framework that other editors will be compelled to follow, but they don't provide any foothold where a new contributor can start working quickly. An empty outline is a set of limitations and no benefits, and this situation can be discouraging enough to a new contributor to drive them to start a separate book, or even leave Wikibooks entirely.

The outline phase of a book should be brief. Outlines should quickly be filled with at least a base amount of content so that future authors and editors have some raw material to work with. There are tfour major directions that an outline can progress in:

 * Stubs:A small amount of text can be added to all or most of the pages in an outline to convert it to a stub. Stubs should contain basic information about the subject and the organization, so that future authors know what to write and where to write it. Following a form is much easier when there are guidelines. Books in this condition will likely be marked with or  templates.
 * Macropedias:Pages can be seeded with articles imported from Wikipedia. In these early stages they become a "macropedia", which is like a collection of encyclopedia articles on a single topic. Macropedias created by importing text from Wikipedia will need to be extensively de-formatted (dewikified) before future authors can begin to contribute book-like content in a meaningful way. Macropedias that are made in other ways, such as students creating encyclopedia-like chapters as part of a class project, don't need to be dewikified but they will need to be integrated together to form a smooth narrative.
 * Courses:During the progression of a school course, information can be "dumped" into the page as it is received. This means that things like lecture notes, reading notes, assignments and their solutions, and other information received through a course can be uploaded as they are learned. Course-like materials do not need to be de-formatted like Wikipedia articles need to be, but they often need to be restructured, organized, and edited extensively.
 * Content Dump:A content dump is where we start with an outline and quickly add large volumes of unstructured information to it. Content dumps lack the structure of the other types of growth patterns, but can grow at some of the quickest rates. Notice that content dumps will need major rearranging, revising to produce a consistent narrative, and formatting to make the book more attractive and approachable.

Link List
A step up from an outline is a link list. Link lists are collections of links to other books, other wikis (such as Commons, Wikipedia, or Wikisource), or other places where information about the subject can be obtained. Link lists can be helpful in organizing resources and finding places to import raw material from, but they are also very dangerous. Link lists or "Link farms" are a violation of policy, and they likely will be deleted if they do not evolve quickly. If you would like to maintain a list of resources for your own use, it is typically better to do it in your own userspace where many such content policies do not apply.

Stubs
Stubs are a page, or several pages, with only a brief amount of starter text. This starter text can often explain what the page is going to cover, and provide a small amount of introductory text that other authors can help to expand. A "good stub" should:

 * 1) Explain clearly what the page will cover
 * 2) Provide a brief introduction to the topic
 * 3) Provide an organizational framework (named headings, for instance) to help show where information should go.

Stubs that do not contain this information are likely to be more of a hindrance than a help to future authors, and should likely be deleted.

Macropedias
A great way for some books to get started is to import related articles from Wikipedia. Wikipedia articles, after being deformatted, contain large amounts of information that can eventually be revised and rearranged to form a book module. This task isn't an easy one, but often times starting with a full page of information can help the author to see what information needs to be incorporated in the page.

Macropedias are not allowed as a final product, but they are an acceptable first stage in constructing a new book.

Courses
New books started by groups, such as class projects, often take the form of the group that created them. This means that class groups will tend to create books that follow the outline for a school course.

As in a macropedia, above, sometimes a book can get off to a great start by first dumping information on the page in a formless manner, and then shaping that book later. In that vein, a course-like book can be viewed as an early production phase for a proper book. Often, books in a course-like stage can be easily forked to Wikiversity, so that both an online course and the accompanying textbook can be in development simultaneously.

Metadata
Groups, especially class groups, tend to require a certain amount of hierarchical organization among their members. This organization often plays out in the book in the form of group meta-data such as "attendance" sheets, notes about which group members are working on which chapters, information about the project itself so that other contributors understand what's going on, et cetera. This metadata should likely be confined to the talk pages, although sometimes this isn't an attractive short-term option.

Whenever metadata is being stored in the book namespace, the long term goal should be for that data to be distilled to it's important components and moved to a special location on a page entitled "About This Book", or "Authors", or something similar. You should always be mindful that long after your group has finished working on the book, other authors will be working on it and will want to add their own names to the list of authors. They may even want to get in touch with you later to let you know how things are going.

Book
A book is not just a collection of information like a macropedia or a course-like book will be. Books should be unified and continuous with a central narrative that builds on old information in order to present new information. Starting with an intermediate form, authors should:

 * 1) Rearrange materials into a logical order. Easy, fundamental concepts should go in the beginning, and more advanced concepts should be moved towards the end. Vocabulary words should be defined before they are used in the text.
 * 2) Format material like a book. Long lists of bullet points or long numbered lists should be replaced with paragraphs of prose. Beyond just simple prose, a book should be written in such a way that readers will be able to learn from it, and not just be a simple presentation of facts or figures.
 * 3) Remove excess markup. Excessive markup, such as large numbers of wikilinks, bold and italics text, and large lists should be removed. Markup should be used to enhance certain points, but not be used so often as to distract the reader.

Featured Book
The last development stage for a book, but certainly not the end of development, is for the book to become featured.


text: User talk:72.39.182.179

title: User talk:72.39.182.179


text:
User talk:Pavel T.

Nothing here....

title: User talk:Pavel T.


text:
Futurebasic/language/syntax

Introduction to the FB Language
An FB program consists of a series of statements, and optional statement labels. Usually you will write each statement on a separate line; however, it’s possible to put multiple statements on a single line, and conversely a single statement may span multiple lines.

You can write multiple statements on a single line by separating each pair of statements with a colon, as in this example: A = 7 * B : Print score(A) : Fn doSum(x)

If a line ends with the continuation character, the (last) statement on that line continues on the next line. The continuation character looks like this: ¬, and it is typed by entering Option-L. Example: myArray(numberDogs, numberCats, numberPorcupines) ¬ = Fn createMenagerie(Mid$(animalName$(x), ¬ nameOffset, 4), vetNumber) While you can safely insert a line-break character [option-L] in a quoted string, elsewhere it is wise to only insert line-break characters between statements, and definitely not to mix them with block statement. For those who still use line numbers, any line in your program (except lines which follow a continuation character) may begin with a line number.

Certain special statements mark the beginning or end of a “block structure.” A statement which opens or closes a block structure should not appear with any other statement on the same line. Such statements include the following:

Begin Enum... End Enum Begin Globals... End Globals Begin Record... End Record BeginAssem... EndAssem Compile Long If... Compile Xelse... Compile End If Dim Record... Dim End Record Do... Until EnterProc... ExitProc EnterProc%... ExitProc% For... Next Local Fn... End Fn Long Fn... End Fn Long If... Xelse...End If Select Case... End Select Case While... Wend
 * 1) If... #Else... #EndIf

Line Numbers
Any line in your program (except lines which follow a continuation character) may begin with a line number. A line number must be an integer in the range 1 through 65534, and no two lines may have the same number. At least one space character should separate the line number from the first statement in the line. Example: 140 Print "Hello": Beep Line numbers can be useful for identifying a particular location in your program, as a target for statements such as  or. However, line numbers are considered an antiquated syntax feature, and their use is generally discouraged.

Statement Labels
A statement label is another way to identify a particular location in your program. A statement label must appear on a line by itself, and the same label can’t appear more than once in your program. Depending on your Preferences settings, you can express a statement label in the following ways:

A string of characters inside double-quotes. Example: "My First Label" A string of non-space characters followed by a colon. This kind of label is only available if the “Allow QuickBasic Labels” preference is set (See the Editor manual). Example: Label17: Like line numbers, statement labels can be useful if your program contains statements like or ; or if your program uses the   or   functions.

Note that when the preference for QuickBASIC labels is turned on a FutureBASIC statement may look like a QuickBASIC label to the compiler. Example: Print:Stop:Rem this won't work with QB labels On Because QuickBASIC labels require that no space be present between the text and the colon, you can side step possible errors as follows: Print : Stop : Rem note the space before the colon

Executable and Non-executable Statements
Every statement in FB is either an executable statement or a non-executable statement.

Executable statements represent instructions which are to be performed when the program is run. When you run your program, a given executable statement may be performed once, or more than once, or not at all, depending on the program conditions. The order in which executable statements are performed is not necessarily the same as the order in which they appear in your program. Examples of executable statements are: ;  ;  ;.

Non-executable statements represent instructions which tell the FB compiler how to build your program. They help the compiler to determine how to allocate memory, and how to interpret and compile other statements in your program. The order in which non-executable statements appear in your program is important: when the compiler builds your program, it scans all statements from top to bottom, and a non-executable statement can only affect the interpretation of lines which appear below it. You cannot change the effect of a non-executable statement by putting it inside a “conditional execution” block such as, or  . However, you can conditionally include or exclude a non-executable statement from the program by putting it inside a  block. Examples of non- executable statements are: ;  ;  ;.

Program Layout and Order of Execution
Parts of your program may be located within function blocks and procedure blocks. Function and procedure blocks are blocks of statements which are surrounded by the following pairs of statements: Local Fn...End Fn Long Fn...End Fn EnterProc...ExitProc Statements which are outside of all function and procedure blocks are said to belong to the “main” part of your program. “Main” statements may either precede function & procedure blocks, or follow them, or both.

When your program runs, the first executable statement that appears in “main” is the first statement that actually executes. After that, the order of execution depends on the specifics of the program: normally, statements are executed in the order in which they appear in “main,” but the flow of execution can be altered by statements like ;  ;  ; ; etc. Function blocks and procedure blocks are not executed until they are explicitly “called,” using a statement like. The program stops when it reaches an  or   statement, or when it reaches the last statement in “main.” Note that if there are no executable statements in “main,” your program won’t do anything.

Identifiers
An identifier is a name that you make up to identify something in your program. In FB, identifiers are used to name the following kinds of things:

 * variables;
 * arrays (see below);
 * user-defined functions (see the,   etc. statements);
 * user-defined data types (see the  and   statements);
 * record fields (see the  and   statements);
 * symbolic constants (see the “Constant declaration” statement).

In FB, an identifier can have any length up to 245 characters. It must start with a letter; its subsequent characters can be any combination of letters, numeric digits, and underscore characters ( _ ) (symbolic constant names should not contain embedded underscores). Identifiers which represent variables, arrays and function names may also be followed by a “type-identifier suffix,” which is a 1- or 2-character symbol that specifies the item’s data type (see Appendix C for a list of type-identifier suffixes). Identifiers are “case-insensitive,” so the identifiers and  are both recognized as the same identifier.

You can use the same identifier to name two different things, as long as the context makes it clear which thing is being referred to. For example, your program may have a variable identified as, and also a local function identified as  ; FB can distinguish between these two, because references to local functions are always preceded by the  keyword in your program.

Variables
A variable can be thought of as a “named container for data.” There are a number of different ways to represent variables in FB; see Appendix B for more information. Every variable is associated with a “data type,” which determines the amount of memory that the variable occupies, and how the variable’s value is interpreted. There are a number of data types predefined in FB; you can also create user-defined data types called records. See Appendix B: Variables for more information.

Arrays
An array is a collection of variables which all share the same name and same data type. Each variable in the collection is called an element of the array; your program distinguishes one element from another by means of subscripts, which are numbers in parentheses following the array’s name. For example, if  is the name of an array, then represents one element of the array, and  represents a different element of the array.

The example above illustrates a one-dimensional array. In a two-dimensional array, each element is represented by a unique ordered pair of subscripts. If  is the name of a two- dimensional array, then  represents an element of the array, and represents a different element of the array. An array can have more than two dimensions; in fact, it can have up to 255. You use the statement to declare how many dimensions a given array has, and to specify the maximum values that can be assigned to each subscript.

The minimum value that can be assigned to a subscript is always 0.

Conventions Used in this Manual
In the syntax descriptions that appear in the remainder of this manual, the following conventions apply:

[ ] { } | …
 * Items in  represent placeholders which should be replaced as indicated in the description;
 * Items in  represent literal text that you should enter exactly as shown;
 * Items in  represent literal text that you should usually enter exactly as shown; however, the following characters should not be entered, but have special meanings explained below:
 * Items enclosed in square brackets [ ] are optional;
 * Items separated by vertical bars | and enclosed by curly brackets { } represent a list from which one item should be chosen;
 * Items separated by vertical bars | and enclosed by square brackets [ ] represent a list from which one or zero items should be chosen;
 * An elipsis (…) indicates that the preceding item may be repeated an indefinite number of times.

Example: Consider the following syntax description template: bob [, {bill | ron [, rick]}] This template matches each of the following: bob bob, bill bob, ron bob, ron, rick

title: Futurebasic/language/syntax


text:
Futurebasic/Language/printing

Printing from FB
Revised: February 2002 (FB^3 Release 6)

Description
You may envision the printed page as something very similar to a window. In general, commands used to produce any type of display on the screen will produce a similar imprint on the page. The exception would be controls which cannot be sent to the printer port.

You instruct your program to switch to the printer using the  command. route _toPrinter rem printing commands here route _toScreen You may freely switch back and forth between the printed page and the screen by executing  commands. When it is time to eject a page or to terminate printing entirely, you can clear the page with  or close down the printer (which has the side effect of automatically clearing the page) with.

Page Size
You can query the printer as to how large the page is by routine output to the printer, then executing  functions. route _toPrinter pageWidth = window( _width ) pageHeight = window( _height ) route _toScreen

Print Dialogs
Two dialogs are used before printing. The first is a style dialog that lets the user determine page orientation, scaling, and other items. This is usually brought up in response to selection of the Page Setup item under the File menu. The syntax is.

The second common dialog is a job dialog. It lets the user determine how many copies will be printed, which page numbers will be included, and other items that vary from one printer to the next. The job dialog is brought up with  and is normally displayed before each print session. Note that the Print Manager actually handles the details of the job. If the user wants to print 2 copies of pages 7 through 10, your application may happily print a single copy of the entire document and the Print Manager correctly filter the output to adhere to the user's request.

Appearance Manager Printing
Because buttons cannot be sent to the printed page, Appearance Manager edit fields cannot be printed. There is a simple work around. Create the edit fields in a window, then use the edit field statement (with only the field number as a parameter) and it will be copied to the printer. The following example show how this is done.

// Appearance Manager printing window 1 edit field 1, "This is a test", (10,10)-(120,32) // Now print it route _toPrinter edit field 1 route _toScreen In this example, we did not clear or close the printer ( or  ). This is because the operation is automatically performed when the program terminates.

title: Futurebasic/Language/printing


text:
Futurebasic/Language/files folders

Specifying Files and Directories
There are a number of FB statements and functions in which you must specify a particular file and/or a particular directory. A directory is basically a folder; in addition, every volume (basically, every disk) has a root directory, which has the same name as the volume itself. A directory is a container; when you double-click on a folder icon in the Finder, you see a window which shows that directory's contents. Likewise, when you double-click on a volume's icon, you see a window which shows the contents of that volume's root directory.

As the MacOS has evolved, a number of different schemes have emerged for specifying files and directories. The statements and functions in FB use a system which involves three different pieces of information, which interact in ways that are sometimes subtle. These pieces of information are: the Path Name, the Directory Reference Number, and the Directory ID Number.

The Path Name
In the MacOS, a path name is a string of no more than 255 characters, consisting of colons and/or names of files and directories in a particular format. It's usually identified as  in syntax descriptions in the manual.

 * A full path name begins with the name of a volume, and ends with the name of a file or directory that is somewhere within that volume. In between is a hierarchical list of the directories leading from the root level to the final item; the names in the list are separated by colons. If the last item in the list is a directory, it may optionally be followed by a final colon. A full path name always contains at least one colon, but never begins with one. A full path name which consists of just the volume's name followed by a colon, indicates the volume's root directory.
 * A partial path name either begins with a colon, or consists of just a single item's name with no colons. It indicates a hierarchical directory path relative to some "base directory" (discussed below). A partial path name that contains no colons indicates an item at the base directory's first level. A partial path name that consists only of a colon (with no item names listed) refers to the base directory itself. A partial path name may also begin with multiple colons: a leading double-colon indicates that the path begins at the base directory's parent; a leading triple-colon indicates that the path begins at the base directory's "grandparent," and so forth.

The Directory Reference Number
This is a peculiar concept which, for historical reasons, can be interpreted in a number of different ways depending on its value. It can also be interpreted as indicating either a volume, or a particular directory on a volume, depending on the value of another quantity called the "Directory ID Number" (discussed below). The Directory Reference Number is always stored as a "signed short-integer" number, so it can range in value from -32768 to +32767. It's usually identified as  in syntax descriptions in the manual.

Note: A Drive ID Number is assigned to each disk drive when the system starts up. A Volume Reference Number is assigned to each volume when it's mounted, and is valid until the volume is unmounted. A Working Directory Reference Number is assigned to a particular directory on a particular mounted volume at the request of your application, and is valid until your application "closes" that directory (as with the  statement), or your application quits.

The Directory ID Number
This is a positive number that the MacOS assigns permanently to each directory at the time the directory is created. On any given volume, no two Directory ID Numbers are the same; however, two directories on two different volumes might both have the same Directory ID Number.

In those FB statements that use a Directory ID Number, you can use two different techniques to specify the number:

You can specify it explicitly as a parameter to the statement. It's usually identified as   in syntax descriptions in the manual. If you don't specify it explicitly, FB uses the number that you've specified in the  statement. If you haven't yet executed the  statement, FB uses zero. Also, the,  ,   and   statements always automatically reset the   value back to zero after the statement executes.

Note: certain other FB statements and functions (such as ) do not use a Directory ID Number and don't pay attention to the   value. Another way to put it is: such statements and functions always behave as though the Directory ID Number were zero.

How These Three Things Interact
FB uses the Path Name, the Directory Reference Number and the Directory ID Number in the following ways to identify which file or directory you're indicating:

 * If the Path Name is a full path name, then the Directory Reference Number and Directory ID Number are ignored. The item is completely specified by the Path Name. (Note that if there are two mounted volumes which both have the same volume name, then a full path name can be ambiguous.) If the Path Name is a partial path name (or is not specified), then the Directory
 * Reference Number and Directory ID Number are used together to identify a base directory. The item, as identified by the partial path name, is then located relative to that base directory (or, if no Path Name is specified, the item is the base directory itself). The base directory is determined as follows:
 * If the Directory ID Number is zero, then the base directory is determined entirely by the Directory Reference Number, according to the "Directory Interpretation" column in the table above.
 * If the Directory ID Number is nonzero, then both the Directory ReferenceNumber and the Directory ID Number are used to identify the base directory. In this case, the base directory's volume is indicated by the Directory Reference Number (according to the "Volume Interpretation" column in the table), and the Directory ID Number identifies a directory within that volume.

Other Ways to Specify Items
When you specify files or folders in calls to MacOS Toolbox routines, you don't always need to use the three data items discussed above. The preferred way to identify a file or folder in many Toolbox calls is by means of a fileSpec, which is a 70-byte record containing a volume reference number, a directory ID number, and the item's name. To track an item which may not be on a currently mounted volume, or which may have been renamed or moved to a different folder, the preferred method is to use an alias record. Refer to Inside Macintosh: Files for a complete discussion of fileSpec's and alias records.

Note that many MacOS Toolbox routines also support the use of Path Names, Directory Reference Numbers (usually called, and Directory ID Numbers, using exactly the same rules of interaction discussed above.

title: Futurebasic/Language/files folders


text:
Futurebasic/language/variables

Variables
In FB, a variable can be thought of as a named container for data. The "container" has a specific size and (usually) a specific address in memory. Also, each variable has a specific type which determines how FB interprets its contents. You can copy data into a variable by putting the variable on the left side of the "=" symbol in a  statement; or by explicitly modifying the contents at the variable's address (through statements like   and  ). Certain other FB statements and functions (such as  and  ) may also modify a variable when you include the variable as a parameter. In FB, a variable can have any of the following forms:

  A simple string or numeric variable, such as:, or. is the optional type-identifier suffix, such as " ", " ", " ", etc. See the  statement, and Data Types and Data Representation, for a complete list of type-identifier suffixes. Examples: myIntVar xyz&  (Note: the square brackets are part of the variable) This variable consists of the single byte which is located at  bytes past the beginning of the string variable. (The  is required) This variable's type is. This kind of variable is normally used to quickly retrieve or alter a single character in a string. The statement, " " is equivalent to: " ". The statement, " " is equivalent to: " ". Examples: firstname$[3]  A pointer variable. This is an identifier declared as a  type; it can be declared either as a "generic" pointer, or a pointer to some other specific type. Examples: myPtr anotherPtr  A handle variable. This is an identifier declared as a  type; it can be declared either as a "generic" handle, or a handle to some other specific type. Examples: myHandle thisHdl  The variable is an entire record. This can be either a "pseudo-record" (declared using ), or a "true record" (declared using  ). Examples: myTrueRec iopb  The variable is a specific element of an array. This can be an array of any type, but  can only be used in numeric or string arrays. Note that an entire array is not considered to be a variable. Examples: firstName$(15) recArray(3, x%)  This variable consists of the bytes located at a specific offset from the beginning of a "pseudo-record." ,  etc. are previously-defined non-negative symbolic constant names (minus their leading undersorce character), or non-negative integer literals. The address of this variable is at ( +   + ...) bytes past the beginning of the pseudo-record. The size and type of this variable are determined by  (for example, if   is " ", then the variable is a 4-byte signed long integer). Examples: House.streetName$ pBlock.ioDrUsrWds.frRect.left%  This variable consists of the bytes located at a specific offset from the beginning of a specific element in an array of "pseudo-records." The address of this variable is at ( +   + ...) bytes past the beginning of the array element. The size and type of this variable are determined by. Examples: HouseArray.streetName$(42,6) pb.rect.bottom%(z)  The variable consists of the bytes located at a specific offset from the address given in. The address of this variable is at ( +   + ...) bytes past the given address; the size and type of this variable are determined by. must be a (signed or unsigned) long-integer variable, or a generic variable. must be a "simple" variable; it cannot be an array element nor a record field. Examples: recPtr&.myField%` genericPtr.rectangle.right%  The variable consists of the bytes located at a specific offset from the beginning of the relocatable block referenced by. The address of this variable is at ( +  + ...) bytes past the beginning of the block. The size and type of this variable are determined by. must be a (signed or unsigned) long-integer variable, or a generic  variable. must be a "simple" variable; it cannot be an array element nor a record field. Examples: recHdl&..thisField.thatField$ genericHandle..someField``

Variables Involving Fields of "true records"
The fields of a "true record" are defined inside a ... block. A field's declared data type can be any valid type; if a field is itself declared as another "true record" type, then the field can have "subfields," which are just the fields of that secondary record.

A field can also be declared as an array (of any type). In this case, whenever the field's name is included as part of a variable specification, it must be followed by subscript(s) in parentheses. Thus, in each of the variable descriptions listed below, each  and   takes one of the following forms, depending on whether or not it's an array field.

For non-array fields: field/subfield ::= fieldName[tiSuffix]

For array fields: field/subfield ::= fieldName[tiSuffix](sub1 [,sub2...]) The type and size of each of the following variables is just the type and size of the last  or   specified.   The variable is the specified field or subfield of the specified "true record." Examples: myTrueRec.myField% stats.game(7).teamName$(1)  The variable is the specified field or subfield of the "true record" pointed to by. The  must be declared as a pointer to a specific type of record. Examples: ptr1.myField ptr2.arrayField$(3)  The variable is the specified field or subfield of the "true record" referenced by. The  must be declared as a handle to a specific type of record. Examples: Hdl1..book(3).title$ Hdl2..phoneNum <li> This variable is the specified field or subfield of a specific element in an array of "true records." Examples: HouseArray(42,6).streetName$ season(2).game(3).player(6) <li> This variable is the specified field or subfield in a "true record" pointed to by an element in an array of pointers. The array must be declared as an array of pointers to a specific type of record. Examples: myPtrArray(n).field3& ptrArray(6,2).miscInfo.chapter(7).title$ <li> This variable is the specified field or subfield in a "true record" referenced by an element in an array of handles. The array must be declared as an array of handles to a specific type of record. Examples: myHndlArray(7,j)..map myHndlArray(7,j)..map.quadrant(x,3).icon& </ul>

Limitations
There are some limitations on how many variables can be assigned.
 * 1) Arrays are limited to about 2 gigabytes (each).
 * 2) Simple variables inside of a local function are limited to 32K (per local function). In FBtoC the limit for local arrays is the same of global arrays (2 gigabytes). (See Why translate to C when I code in BASIC? ).
 * 3) The  file of a project often allocates variables outside of local functions that are not global. These are treated as variables for a local function and are limited to 32K. In FBtoC the limit is the same of global arrays (2 gigabytes).

title: Futurebasic/language/variables


text:
Futurebasic/Language/data types

Data Types and Data Representation
Revised: May 30, 2000 (Release 3)

Integers
Integers can be represented as literals, as symbolic constants, or as variables.

Integer Literals
 Decimal: a string of decimal digits, optionally preceded by "+" or "-". Examples: 7244     -328442  Hexadecimal: a string of up to 8 hexadecimal digits, preceded by " " or " " or " " (that's a zero-x). Hexadecimal digits include the digits 0 through 9, and the letters  through. Letters can be either in upper or lower case. Examples: &H12a7     0x47BeeF      &42AD9 Octal: a string of up to 10 octal digits, preceded by " " (that's the letter " ", not a zero). Octal digits include the digits 0 through 7. Examples: &o70651     &o32277 Binary: a string of up to 32 binary digits, preceded by " ". Binary digits include the digits 0and1. Examples: &x0100011     &x10110000111011001 Quoted: a string of up to 4 characters, surrounded by double-quotes, with an underscore preceding the initial quote. Each character in the quoted string represents 8 bits in the internal bit pattern of the resulting integer, according to the character's ASCII code.

Examples: _"TEXT"     _"N*"  Note: Hexadecimal, octal, binary and quoted literals reflect the actual bit patterns of the integers as they're stored in memory. These may be interpreted either as positive or negative quantities, depending on which types of variables they're assigned to. If they're not assigned to any variable, they're generally interpreted as positive quantities.

Symbolic Constants
A symbolic constant is an identifier preceded by an underscore character. There are many symbolic constants which have pre-defined values in FB. You can also define your own symbolic constants within your program, either by using a ... block; or a  ...  block; or by using a "constant declaration" statement. A constant declaration statement has this syntax: _constantName = staticExpression where  is a symbolic constant which has not been previously defined, and   is a "static integer expression" (see Appendix D: Numeric Expressions). The value of  must be within the range -2,147,483,648 through +2,147,483,647. Once a symbolic constant has a value assigned to it, that value cannot be changed within your program. Like all constants, a symbolic constant has a global scope.

A constant declaration may also include pascal style strings using one of the following formats _constantName$   = "I am a string constant" _constantTab$    = 9      : REM CHR$(9) = tab character _constantCR$     = 13     : REM CHR$(13) = carriage return _twoByteKanjiChar = 10231 : REM KCHR$(10231)

Integer Variables
There are six different types of integer variables in FB; they differ in the amount of storage space they occupy, and in the range of values they can represent. An integer variable's name may end with a type-identifier suffix which indicates its type; alternatively, you can declare an integer variable's type by using the  clause in a   statement. If a variable has no type-identifier suffix, and wasn't declared with an  clause, then FB checks whether there are any   statements which are applicable to the variable. Finally, if the variable can't be typed by any of the above means, FB assigns the type "signed short integer" to the variable. Arrays of integers, and integer record fields, are typed by similar means.

Real Numbers
"Real numbers" are numbers which may have a fractional part. They can be represented as literals or as variables.

Real Number literals
 Standard notation: a string of decimal digits including a decimal point; optionally preceded by "+" or "-". Examples: 17.3     -62.       0.03 Scientific notation: a string of characters in this format:

is a string of decimal digits with an optional decimal point, optionally preceded by "+" or "-";  is a string of decimal digits, optionally preceded by "+" or "-". Examples:  3e-20     -6.7E4      0.05E+14 The value of a number expressed in scientific notation is: exponent

Real Number variables
There are three types of real number variables in FB; they differ in the amount of storage space they occupy, the range of values they can represent, and their precision (number of significant digits).

Fixed-point Reals
A fixed-point real number variable must be declared in a  statement, using the   clause. It's accurate to about 5 places past the decimal point, and can handle numbers in the range of approximately -32767.99998 through +32767.99998. A fixed-point variable occupies 4 bytes of storage.

Floating-point Reals
FB supports two kinds of floating-point real number variables. A floating-point variable's name may end with a type-identifier suffix which indicates its type; alternatively, you can declare a floating-point variable's type by using the  clause in a   statement. If a variable has no type-identifier suffix, and wasn't declared with an  clause, FB checks whether there are any   or  statements which are applicable to the variable. Floating-point arrays, and floating-point record fields, are typed by similar means.

The methods used by FB when handling one of these variables can be modified by you. A set of constants is maintained in a file in the headers folder. (Path: FB Extensions/Compiler/Headers/UserFloatPrefs). If you want to change these parameters for all of your projects, copy the file named "UserFloatPrefs" into the User Libraries folder. The User Libraries folder is located at the same level as the editor. // // Required Floating Point Constants // // _NumberLeadingSpace = _True //FB II Default = _true _RoundUpFloat2Long = _true // Un-remark to round up Float to Integer Double-precision floating-point variables occupy more storage, represent a greater range of values, and have greater precision than single-precision floating-point variables. (4 bytes) double-precision

(8 bytes

Strings
A string is a list of up to 255 characters, which is usually interpreted as text in MacPascal encoding. Strings can be represented as literals or as variables.

String Literals
A string literal is a group of characters surrounded by a pair of double-quotation marks (note: in certain contexts, such as in  statements, the quotation marks are optional). If the string literal contains a pair of contiguous double-quotes, they are interpreted as a (single) embedded double-quote mark and treated as part of the string, rather than as a delimiter. Example: print "I said, ""Hello.""" Output: I said, "Hello."

String Variables
A  statement specifies a string variable and its size in the following ways: dim as Str255 s // s is a 255 character string dim as Str63 s  // s is a 63 character string dim as Str31 s // s is a 31 character string dim as Str15 s // s is a 15 character string

dim s as Str255 // s is a 255 character string dim s$          // s is a 255 character string dim 3 s$        // s is a 3 character string [the custom size value can range from 1 to 255]

dim as Str31 s$ // s is a 255 character string [this anomaly, present in the old FB Compiler, may be removed from FBtoC]

If a variable has no type-identifier suffix, and wasn't declared with an  clause, then FB checks whether there are any   statements applicable to the variable.

String arrays, and string record fields, are typed similarly to string variables.

Internally, strings are stored in Pascal format, beginning with a length byte indicating the number (0 through 255) of characters currently in the string. The length byte is followed immediately by the string's characters, one byte per character. FutureBASIC always allocates an even number of bytes for a string variable in memory; this is enough to include the length byte, plus enough character bytes for the variable's maximum string length, plus an exta "pad" byte (if necessary) to make the total come out even. Use  to determine the number of bytes allocated to a particular string variable.

Containers
Containers are compiler-managed Handles that hold up to 2 GB of ASCII or numeric information. Containers may be identified by a double dollar sign or in a   statement. In FBtoC containers hold only ASCII information, numeric assignements and operations are not allowed.

Containers are always global. An attempt to dimension a container inside of a local function will result in an error message during compilation. When a container is first dimensioned, it is a long integer variable with a value of zero. Once data is placed in the container, a handle is allocated and the data is moved to that handle. To dispose of the allocated handle, set the container to a null string with.

Because a container may hold ASCII or numeric information, there are some trade-offs. The first is speed. Numeric values stored in containers are first converted to ASCII. When math operations are required, the data is reconverted before the calculation is performed. (In FBtoC containers hold only ASCII information, numeric assignements and operations are not allowed.)

Another limitation relates to how containers are filled. Since FB has no idea what data may be in the container, it has to evaluate the information on the other side of the equal sign to see what it should be doing. If this data is a series of Pascal strings, then the container must be limited to 255 characters. myContainer$$ = a$ + b$ + c$ If the information is to be a concatenated string and the right side of the equal sign contains only Pascal style strings, you must approach things from a different direction. myContainer$$ = a$ myContainer$$+= b$ myContainer$$+= c$ In some cases, the compiler will not be able to determine what type of operation you had in mind. For instance... a$$ = b$$ + c$$ The compiler has no clue as to whether it should concatenate strings or add numbers. You can force the correct operation by inserting an additional operator. a$$ = b$$ + c$$ + 0 : REM math a$$ = b$$ + c$$ + "" : REM strings This is not a problem with other math operators like the minus sign or the multiplication (asterisk) symbol as these cannot pertain to strings.

Containers may not be compared in the traditional sense. This is because a comparison by its very nature must return a numeric value. If you execute a statement like  the result will be zero  or -1. We have provided a substitute function that can handle the comparison for you. rslt& = fn FBcompareContainers(a$$,b$$) If  is less than   then the result will be negative and will represent the character position at which the difference was found. If  is -3000 then   and   were identical for the first 2999 characters, at which time the next character in   was found to be less than the one in.

When  is zero, the containers are equal.

When  is positive, it points to the character position at which it was determined that   is greater than.

Containers are stored in the application heap as relocatable blocks. You can extract the handle to these blocks as follows: hndl& = [@myContainer$$] Be aware that the handle may be zero if the container has been cleared or if it was never initialized.

A syntax similar to that used for filling edit fields may be used to pass information to a container. The percent sign indicates that the container is to be filled with the contents of a   resource. An ampersand tells FB to fill the container with information from a Handle. a$$ = %resID // fill container with TEXT res ID resID a$$ = & myHandle; // fill container with contents of myHandle Note: You may not use complex expressions that include containers and/or Pascal strings on the right side of the equal sign. Instead of using: c$$ = c$$ + left$$(a$$,10) d$$ = c$$ + a$ Use: c$$ += left$$(a$$,10) d$$ = c$$ d$$ += a$

Pointers
A pointer variable is always declared in a  statement. It can be declared using the  (or  ) clause, or an   clause, where   is a type which was previously identified as a   type (in a   statement). If the  clause included a   clause, then the variable is identified as "pointing to" a data structure of the indicated type; otherwise it's considered a "generic" pointer.

The value of a pointer is actually a long integer; it's the address of a data structure. In some cases a pointer's value may be  (zero), which indicates that the pointer currently isn't "pointing to" anything.

If you declare a pointer variable as pointing to a particular record type, you can use the pointer variable to refer to specific fields within a record (see Appendix B: Variables, for more information). This is the main advantage of using pointer variables rather than long integer variables to store a data structure's address.

Handles
A handle variable is always declared in a  statement. It can be declared using the  (or  ) clause, or an   clause, where   is a type which was previously identified as a   type (in a   statement). If the  clause included a   clause, then the variable is identified as a handle to a data structure of the indicated type; there are also a couple of pre-defined types (  and  ) which are recognized as handles to particular types of MacOS structures (specifically: to regions and TextEdit records). If the variable is declared simply " " (with no  clause), it's considered a "generic" handle.

The value of a handle is actually a long integer; it's the address of a "master pointer" which points to a relocatable block that contains a data structure. In some cases a handle's value may be  (zero), which indicates that it doesn't currently refer to any data structure. You can use a long integer variable to store the same address as a handle variable, and for many purposes handle variables and long integer variables are interchangeable.

If you declare a handle variable as referring to a particular record type, you can use the handle variable to refer to specific fields within a record (see Appendix B: Variables, for more information). This is the main advantage of using handle variables rather than long integer variables to store a handle value.

Records
A record is a collection of data items that are stored together in memory. You can access an entire record as a unit, or access its data elements individually. Unlike an array, whose elements are all of the same type, the elements of a record (also called its "fields") can be of differing types.

A record variable must be declared in a  statement: dim varName as RecordType dim as RecordType varName where RecordType is previously-defined record type. You can define a record type and its fields by using a  ...   block. In addition, FB recognizes two built-in record types:  and. You use the  syntax to access the fields of a record variable (see Appendix B: Variables).

Compatibility of Types
You can assign values of one type to variables of another type, sometimes with certain restrictions. The following table shows which kinds of values can be assigned to which kinds of variables.

title: Futurebasic/Language/data types


text:
Futurebasic/Language/numeric expressions

Numeric Expressions
Revised: May 30, 2000 (Release 3)

A numeric expression is anything that can be evaluated as a number. A number can be expressed in the following ways:

Simple expressions
 A numeric literal, a symbolic constant, or a numeric variable. See Appendix C:Data Types and Data Representation, for more information. Examples: 17.3     _true      x&      Z%(14) A reference to any user-defined function or Toolbox function that returns a numeric value. Examples: FN theSum#     FN GETCATINFO(@pb) A value returned by any built-in FB function whose name does not end with " ". (Note: the two exceptions to this are the  function and the   function, both of which return a string value.) Examples: LEN("Hello")     DIALOG(0)

Data comparison expressions
Data comparison expressions always return the value -1 or 0. In many contexts, these values are interpreted as meaning "true" or "false," respectively. Data comparison expressions have the following forms:

Equality comparisons
An equality comparison consists of two expressions of "compatible types" separated by the " " operator or the " " operator (you can also use " " as a synonym for " ", and " " as a synonym for " "). The two operands must fall into one of the following categories:

 A pair of numeric expressions; A pair of string expressions (see Appendix E: String Expressions); Any pair of variables of the same type.

An equality comparison using " " (or " ") is evaluated as -1 if the two operands have equal values; otherwise it's evaluated as 0. An equality comparison using " " (or " ") is evaluated as -1 if the two operands are not equal; otherwise it's evaluated as 0. Examples:

Order Comparisons
An order comparison can test the relative "order" of two numeric operands, or of two string operands; that is, it tests whether one operand is greater than or less than the other. In the case of strings,  is considered "less than"   if it precedes   alphabetically. More accurately, string comparison depends on the ASCII values of the characters in the strings. An order comparison takes the form, where   and   are both numeric expressions or both string expressions, and   is one of the operators in this table:

Examples:

Expressions with Unary Operators
A unary operator is an operator that takes only one operand. FB has three unary operators: " "; " "; " ". The unary operator always appears on the left side of the operand; the operand can be any numeric expression.

Examples:

Compound Expressions
A compound numeric expression is any list of numeric expressions separated by one or more of the operators in the table below. A compound expression has this form:

Additionally, any expression which is surrounded by a pair of parentheses is also an expression. When you surround an expression with parentheses, the entire expression within parentheses is evaluated before any operator to the left or right of the parenthetical expression is applied. This is useful when you want to change the default order in which the operators are applied. For example:

In the above expression, the " " operator is applied before the " " operator. 3 is multiplied by the sum of 7 and 1, giving a result of 24. But if the expression had been written like this:

then the " " operator would have been applied first. In this case, 1 is added to the product of 3 and 7, giving a result of 22.

Examples:

Operator Precedence
When an expression includes more than one operator, the order in which the operations are performed can affect the result. When an operator appears to the left or right of a parenthetical expression, all of the operations within the parentheses are performed first. When several operators all appear within the same matching pair of parentheses (or outside of all parentheses), the order in which their operations are performed is determined by their order of precedence, with "higher precedence" operations being performed before "lower precedence" ones. For example, consider this expression:

The " " operator has a higher precedence than the " " operator (see the table below). So, when this expression is evaluated, first 7 is multiplied by 5 to get 35; then that result is added to 4 to get the final answer of 39.

The following table lists the operators in order of their precedence, from highest to lowest. When an expression contains several operators at the same level of precedence (and within the same depth of parentheses), their operations are always performed from left to right.

Example: Consider the following expression:

The following shows the series of operations that FB performs to reduce this expression to its final value, 31.

Static Integer Expressions
Many FB statements require quantities that are expressed as static integer expressions. A static integer expression may be a simple or complex expression, but its operands are limited to the following:

 Integer literals; Symbolic constants; The,   and   functions.

The following are examples of valid static integer expressions:

The following are not valid static integer expressions:


text:
Futurebasic/language/string expressions

String Expressions
Revised for FBtoC 15 February 2008

Description
A string expression is anything that can be evaluated as a string of 0 to 255 characters. (Note that FutureBASIC also provides "Containers" with 2GB text capacity that operate very similarly to a standard string). A string can be expressed in any of the following ways:

Simple Expressions
 A string literal, or a string variable. See Appendix C: Data types and Data Representation, for more information. Examples: surname$(23)     "Friday" A reference to any user-defined function that returns a string value. Example: fn MyStringFunc$( "something" ) A value returned by any built-in FB function whose name ends with $ Examples: chr$( 7 )     hex$( z& ) A value returned by the  function, or by the   function. Examples: using "##.#"; pi     str#( 130, 5 )

Compound Expressions
A compound string expression is a list of simple string expressions separated by the concatenation operator "+". The syntax of a compound string expression is:

The "+" operator builds a longer string by concatenating the operands. For example:

This expression has the value.

title: Futurebasic/language/string expressions


text:
Futurebasic/Language/file spec

File Spec Records
 CAUTION (Jan. 2008) Although the FSSpec structure represents the current FB standard for specifying files and directories, it is outdated since years and should not be considered for serious new FB projects. There are at least two modern alternatives to the FSSpec structure, namely the opaque FSRef structure explicated in:

“Migrating to FSRefs & long Unicode names from FSSpecs” (Apple Technical Note TN2078, May 2003)

and the FileURL outlined in:

“The death of typeFSSpec: moving along to typeFileURL” (Apple Technical Note TN2022, June 2001) Revised: February 2002 (FB^3 Release 6)

Description
File spec records (FSSpecs) are the modern replacement for FB's time tested volume reference number/file name combinatons. You can create a file spec record as follows:

A file spec record is defined in the headers as follows:

When the FSspec is used as a parameter in, or   the information is passed to file handling calls as a single record, but you may extract information from the record as follows:

OS x vs OS 9 volRefNum
OS X does not allow the use of the older vRefNum/fileName combination. In order to insure that your programs work correctly without modification, the FB runtime creates a list of parent IDs and volume reference numbers and substitutes the list element number for the old volume reference number. Look at the difference between the calls below:

System 9

OS X

Your program won't require changes to move from the old to the new style calls, but will become OS X savvy without any additional coding.

Extracting Real Information From FB Indexed List Information
A utility function has been provided that extracts the true volume reference number and parent ID from FB's indexed table.

Pass the pseudo volume reference number to the routine in the  parameter. On return, the true volume reference number is placed in the  variable and the correct parent ID is place in the   variable.

FSMAKEFSSPEC -> FBMakeFSSpec
A utility function provided by the runtime lets you build a file spec from individual components. This function has been designed to work with all versions of the system software. It's parameters are identical to those of the toolbox version of the call, but this particular function is smart enough to know when it id dealing with real parameters and when it has encountered the indexed element number from FB's substitute parameters.

If the  parameter is a null string, FB returns information about the parent folder.

/* Not Supported by FBtoC */

title: Futurebasic/Language/file spec


text:
Topfield 5800/Troubleshooting/Delete Channel

Duplicate channels may give bad recordings (if a poor quality duplicate channel is used) and may cause various problems with TAPs. To delete a duplicate, old or unwanted channel, press OK to bring up the Channel List, select the channel, then press the Red button and choose the Delete option (note that you cannot delete channels while recording).

You may also want to rescan to include any new channels, especially if there's been a Freeview reshuffle recently (which may have caused channels to appear to be duplicated).

There are TAPs available which can automate the process of deleting the low quality duplicates or other collections of channels (e.g. pay channels).