# PHAEDRA CBLOCK Feature [ rev. 1.3 ]

### 1. General Usage
-------------------------------------------------------------------------------

The "Mark CBlock" function allows you to mark code or text blocks that are enclosed between marker strings. Currently, a character string of 9 x "" is used as the marker string for ergonomic reasons. This character string is easy to spot when scrolling through long text files and is well suited for visually structuring content.

You can use the menu or the hotkey CTRL+Tab to cycle through code blocks, advancing to the next code block on each call. Alternatively, you can use CTRL+Q to select the next CBlock including the marker strings.

To create a code block, select a text range and choose "Range -> Create CBlock" from the menu. Phaedra will automatically add the leading and trailing marker strings. You can also insert the marker strings manually.

Please note:
- There must always be an even number of marker strings in a file. Each CBlock requires its own start and end marker.
- Nested CBlock markers are not supported.
- There must be at least one line of text between the markers; otherwise, the block will be skipped.
- Any additional text can be placed before or after the marker strings. The following marker lines work equivalently:

------------------
 An empty line is necessary


------------------

[ Text ]
/*  */
------------------
/*  Variant for REXX */
[ Rexxcode ]
/*  End REXX */
------------------
 Label
[ Text ]
Label 
------------------


Application examples:

In REXX programming, procedures or subroutines can be marked accordingly:

------------------
/*  */
SUBROUTINE_1: Procedure
[long code here]
return
/*  */

/*  */
SUBROUTINE_2: Procedure
[long code here]
return
/*  */
------------------

When calling "Mark Codeblock", the entire SUBROUTINE_1 (excluding the marker lines) is selected. Calling "Mark Codeblock" again selects SUBROUTINE_2.

You can also use the following file structure, for example, to jump directly to subroutine headers:

------------------
/*  */
/* Subroutine 1 - Just an example - This is a label */
/*  */
SUBROUTINE_1: Procedure
[long code here]
return


/*  */
/* Subroutine 2 - Just an example - This is a label */
/*  */
SUBROUTINE_2: Procedure
[long code here]
return
------------------


### 2. Using Phaedra's CBlock Feature in AI Responses
-------------------------------------------------------------------------------
To structure AI responses and take full advantage of Phaedra's CBlock search and selection features, you can instruct the AI (either in your prompt or within system instruction files) to format generated source code using dedicated block markers:

------------------
- CRITICAL FORMATTING RULE FOR ALL CODE BLOCKS:
Whenever you output source code in *any* programming language, you must NOT use standard markdown code blocks (such as ```python, ```rexx, ```json, etc.). 
Instead, you must enclose the entire code block strictly between these exact custom markers:
Starting marker on a new line (with the respective language identifier):
 [language_name]
Ending marker on a new line:

------------------

This enables Phaedra to instantly navigate between code segments using dedicated menu options and shortcuts (such as "Select next AI code block"), allowing you to cleanly isolate, copy, or process source code without tedious manual selection.
