IB Statements/GetFormat
From CometWiki
(Difference between revisions)
m (much better looking) |
|||
| Line 1: | Line 1: | ||
| - | GetFormat | + | =GetFormat= |
| - | Syntax: GetFormat format-statement-label string$ | + | Syntax: GetFormat format-statement-label string$ |
| + | |||
Discussion: The GetFormat statement distributes one string amongst the contents of all variables in a FORMAT. | Discussion: The GetFormat statement distributes one string amongst the contents of all variables in a FORMAT. | ||
| + | |||
Example: | Example: | ||
| - | Length 10 & local a$,b$ | + | Length 10 & local a$,b$ |
| - | MyFormat: FORMAT a$;b$ | + | MyFormat: FORMAT a$;b$ |
| + | |||
| + | GetFormat MyFormat MyString$ | ||
| - | |||
| - | |||
Following the GetFormat, a$ would contain the first 10 bytes of MyString$ and b$ would contain the next 10 bytes. | Following the GetFormat, a$ would contain the first 10 bytes of MyString$ and b$ would contain the next 10 bytes. | ||
| Line 15: | Line 17: | ||
This statement was introduced with Comet32. | This statement was introduced with Comet32. | ||
| - | + | =SetFormat= | |
| - | SetFormat | + | Syntax: SetFormat format-statement-label string$ |
| - | Syntax: SetFormat format-statement-label string$ | + | |
| - | Discussion: The SetFormat statement load the variables in a FORMAT with the contents of a string. | + | Discussion: The SetFormat statement load the variables in a FORMAT with the contents of a string. |
| + | |||
Example: | Example: | ||
| - | Length 10 & local a$,b$ | + | Length 10 & local a$,b$ |
| - | MyFormat: FORMAT a$;b$ | + | MyFormat: FORMAT a$;b$ |
| - | + | ||
| - | + | SetFormat MyFormat MyString$ | |
| - | SetFormat MyFormat MyString$ | + | |
Following the SetFormat, MyString$ would contain the concatenation of a$ and b$. | Following the SetFormat, MyString$ would contain the concatenation of a$ and b$. | ||
Revision as of 00:30, 15 January 2010
GetFormat
Syntax: GetFormat format-statement-label string$
Discussion: The GetFormat statement distributes one string amongst the contents of all variables in a FORMAT.
Example:
Length 10 & local a$,b$ MyFormat: FORMAT a$;b$ GetFormat MyFormat MyString$
Following the GetFormat, a$ would contain the first 10 bytes of MyString$ and b$ would contain the next 10 bytes.
See also SetFormat
This statement was introduced with Comet32.
SetFormat
Syntax: SetFormat format-statement-label string$
Discussion: The SetFormat statement load the variables in a FORMAT with the contents of a string.
Example:
Length 10 & local a$,b$ MyFormat: FORMAT a$;b$ SetFormat MyFormat MyString$
Following the SetFormat, MyString$ would contain the concatenation of a$ and b$.
See also GetFormat
This statement was introduced with Comet32.