IB Statements/GetFormat
From CometWiki
< IB Statements(Difference between revisions)
(New page: GetFormat Syntax: GetFormat format-statement-label string$ Discussion: The GetFormat statement distributes one string amongst the contents of all variables in a FORMAT. Example: Leng...) |
(new syntax) |
||
(5 intermediate revisions not shown) | |||
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. It "reads" the format from the string. | ||
+ | |||
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. | ||
- | See also | + | See also PutFormat |
+ | |||
+ | This statement was introduced with Comet32. | ||
+ | |||
+ | =PutFormat= | ||
+ | Syntax: PutFormat format-statement-label string$ | ||
+ | |||
+ | Discussion: The PutFormat statement loads the contents of a string with the variables in a FORMAT. It "writes" the format into the string. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | Length 10 & local a$,b$ | ||
+ | MyFormat: FORMAT a$;b$ | ||
+ | |||
+ | MyString$ = PutFormat(MyFormat) | ||
+ | |||
+ | Following the PutFormat, MyString$ would contain the concatenation of a$ and b$. | ||
+ | |||
+ | See also GetFormat | ||
This statement was introduced with Comet32. | This statement was introduced with Comet32. |
Latest revision as of 21:50, 18 August 2011
GetFormat
Syntax: GetFormat format-statement-label string$
Discussion: The GetFormat statement distributes one string amongst the contents of all variables in a FORMAT. It "reads" the format from the string.
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 PutFormat
This statement was introduced with Comet32.
PutFormat
Syntax: PutFormat format-statement-label string$
Discussion: The PutFormat statement loads the contents of a string with the variables in a FORMAT. It "writes" the format into the string.
Example:
Length 10 & local a$,b$ MyFormat: FORMAT a$;b$ MyString$ = PutFormat(MyFormat)
Following the PutFormat, MyString$ would contain the concatenation of a$ and b$.
See also GetFormat
This statement was introduced with Comet32.