IB Statements/GetFormat

From CometWiki

(Difference between revisions)
Jump to: navigation, search
m (SetFormat: discussion fixed)
m (tried to make it more clear)
Line 2: Line 2:
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:
Line 20: Line 20:
Syntax:  SetFormat format-statement-label string$
Syntax:  SetFormat format-statement-label string$
    
    
-
Discussion:  The SetFormat statement loads the contents of a string with the variables in a FORMAT.
+
Discussion:  The SetFormat statement loads the contents of a string with the variables in a FORMAT. It "writes" the format into the string.
   
   
Example:
Example:

Revision as of 18:19, 16 February 2010

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 SetFormat

This statement was introduced with Comet32.

SetFormat

Syntax: SetFormat format-statement-label string$

Discussion: The SetFormat 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$

SetFormat MyFormat MyString$

Following the SetFormat, MyString$ would contain the concatenation of a$ and b$.

See also GetFormat

This statement was introduced with Comet32.

Personal tools