This blog post was created with AI assistance based on the official Uniface 10.4 documentation.
When working with Uniface applications, especially when dealing with reports and printing, you'll often need precise control over how your output is formatted. The skip
statement is a simple yet powerful tool that helps you manage line spacing in your printed documents. π
π What is the skip Statement?
The skip
statement is a ProcScript command in Uniface that allows you to skip a specific number of lines during printing operations. Think of it as adding blank lines to your printed output - similar to pressing Enter multiple times in a word processor.
ProcScript is Uniface's procedural programming language used to code application behavior and business logic.
π Basic Syntax
The syntax is straightforward:
skip {Expression}
Where Expression
is the number of lines you want to skip. If you don't specify a number, it defaults to skipping one line.
π‘ Practical Examples
Example 1: Simple Line Skipping
skip 2 ; Skip 2 lines
skip ; Skip 1 line (default)
skip 0 ; Skip 1 line (same as default)
Example 2: Conditional Line Skipping
Here's a real-world example from invoice printing where you skip lines between different invoice dates:
trigger leavePrinted
; Check if we're currently printing
if ($printing = 1)
compare/next (INVDATE) from "INVOICE"
if ($result = 0)
skip 2 ; Skip 2 lines for better readability
endif
endif
end; leavePrinted
What this code does: When printing invoices, if the next invoice has a different date than the current one, it adds 2 blank lines for visual separation.
βοΈ Key Rules and Behaviors
π Printing Context Required
The skip statement only works when Uniface is actively printing. You can check this using the $printing system variable:
-
$printing = 1
means printing is active -
$printing = 0
means not printing (skip statement will be ignored)
π Page Break Behavior
Smart page handling: If you try to skip more lines than remaining on the current page, Uniface automatically issues an eject (page break) and continues on the next page. π
β‘ Immediate Execution
When Uniface encounters a skip statement, it executes immediately without activating other triggers on the current line.
π« What NOT to Do
- Negative numbers:
skip -1
is not supported - Using without printing context: Always check
$printing
first - Decimal numbers: Values are automatically truncated to integers
π§ Common Use Cases
Report Formatting
- Adding space between sections
- Creating visual breaks in data
- Improving document readability
Invoice and Document Generation
- Separating different customers
- Adding space before totals
- Creating professional-looking layouts
π Related Commands
The skip statement works well with other Uniface printing commands:
- eject: Forces a page break
- print: Main printing command
- printbreak: Controls line breaking in printing
π― Best Practices
- Always check printing status: Use
if ($printing = 1)
before skip statements - Use meaningful numbers:
skip 2
for section breaks,skip 1
for small spacing - Comment your code: Explain why you're skipping lines for future maintenance
- Test your output: Always preview printed results to ensure proper formatting
π Getting Started
To start using the skip statement in your Uniface applications:
- Identify where you need line spacing in your reports
- Add the skip statement within your printing triggers
- Always wrap it in a printing context check
- Test your output and adjust the skip values as needed
The skip statement might seem simple, but it's an essential tool for creating professional, well-formatted printed documents in Uniface. Master this command, and you'll have much better control over your application's printed output! β¨
Happy coding! π¨βπ»π©βπ»
Top comments (0)