### Install and Set Up Claude PxPlus Template Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Provides the steps to clone the PxPlus template repository, copy configuration files to the user's home directory, and verify the installation. It also reminds users to configure the PxPlus executable path. ```bash # Clone the template repository git clone https://github.com/Astecom/claude-pxplus-template.git cd claude-pxplus-template # Copy template directories to home directory # Linux/macOS cp -r .claude ~/ cp -r .pxplus-claude ~/ # Verify installation ls -la ~/.claude ls -la ~/.pxplus-claude # Configure PxPlus executable path (required before use) # In Claude Code: /set-pxplus-path /usr/local/bin/pxplus ``` -------------------------------- ### PxPlus File Operations with Error Handling Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Provides examples of common PxPlus file input/output operations, including opening, reading by key, writing, removing records, and sequential reads. It emphasizes robust error handling using ERR, DOM, BEG, and END clauses. ```pxplus ! Open indexed/keyed file with error handling OPEN (1, ERR=OPEN_ERROR) "[wdx]customers" ! Read record by key READ (1, KEY=customer_id$, DOM=NOT_FOUND, ERR=READ_ERROR) \ customer_name$, address$, city$, balance ! Write/Update record WRITE (1, KEY=customer_id$, ERR=WRITE_ERROR) \ customer_name$, address$, city$, balance ! Remove record REMOVE (1, KEY=customer_id$, ERR=REMOVE_ERROR) ! Sequential read through file READ (1, KEY="", BEG=1, DOM=END_OF_FILE) customer_record$ WHILE 1 ! Process record READ (1, END=END_OF_FILE) customer_record$ WEND END_OF_FILE: CLOSE (1) EXIT ! Error handlers OPEN_ERROR: PRINT "Error opening file: ", ERR, ", ", MSG(0) EXIT NOT_FOUND: PRINT "Customer not found: ", customer_id$ RETURN READ_ERROR: PRINT "Read error: ", ERR, ", ", MSG(0) CLOSE (1) EXIT WRITE_ERROR: PRINT "Write error: ", ERR, ", ", MSG(0) CLOSE (1) EXIT REMOVE_ERROR: PRINT "Remove error: ", ERR, ", ", MSG(0) RETURN ``` -------------------------------- ### PxPlus Date and Time Operations using DTE Function Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Demonstrates PxPlus date and time manipulation using the MANDATORY DTE function. Covers getting current date/time, formatting specific dates, performing date arithmetic, and parsing date strings. Supports various format specifiers for flexible output. ```pxplus ! CRITICAL: ALWAYS use DTE function for date/time operations ! Get current date current_date = DTE(0:"%Yl/%Mz/%Dz") ! Returns YYYY/MM/DD ! Get current timestamp timestamp$ = DTE(0:"%Yl-%Mz-%Dz %Hz:%mz:%sz") ! Returns YYYY-MM-DD HH:MM:SS ! Format specific date invoice_date = JUL(2025,10,22) formatted$ = DTE(invoice_date:"%Ds %Ms %Yl") ! Returns "22 October 2025" ! Date arithmetic days_old = DTE(0) - invoice_date ! Days between dates due_date = invoice_date + 30 ! Add 30 days ! Parse date string date_string$ = "2025-10-22" parsed_date = DTE(0:date_string$:"%Yl-%Mz-%Dz") ! Common date formats ! %Yl = 4-digit year (2025) ! %Mz = 2-digit month (01-12) ! %Dz = 2-digit day (01-31) ! %Hz = 2-digit hour (00-23) ! %mz = 2-digit minute (00-59) ! %sz = 2-digit second (00-59) ! %Ds = Day with suffix (1st, 2nd, 3rd) ! %Ms = Full month name (January, February) ``` -------------------------------- ### PxPlus Traditional Program Structure with Subroutines Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Demonstrates a classic PxPlus program layout featuring labels, subroutines (GOSUB/RETURN), and basic control flow for program execution. It includes variable declarations, file opening/reading, and conditional logic. ```pxplus PRECISION 6 SET_PARAM 'EZ'=1 ! Main program - entry point MAIN: LOCAL customer_id$, total_sales, found_count LET customer_id$ = "CUST001" LET total_sales = 0 GOSUB PROCESS_CUSTOMER GOSUB CALCULATE_TOTALS EXIT ! Exit the program ! Subroutine - must end with RETURN PROCESS_CUSTOMER: OPEN (1) "[wdx]customers" READ (1, KEY=customer_id$, ERR=CUSTOMER_NOT_FOUND) customer_record$ found_count = 1 CLOSE (1) RETURN CUSTOMER_NOT_FOUND: found_count = 0 RETURN CALCULATE_TOTALS: IF found_count THEN { total_sales = 10000.50 PRINT "Total Sales: ", MSK(total_sales, "$###,##0.00") } RETURN ``` -------------------------------- ### Copy PxPlus Template Directories to Home Directory Source: https://github.com/astecom/claude-pxplus-template/blob/master/README.md These commands copy the necessary configuration directories (.claude and .pxplus-claude) from the template into the user's home directory. This step is crucial for Claude Code to recognize and utilize PxPlus-specific rules and documentation. ```bash # Copy the .claude directory (general instructions) cp -r .claude ~/ # Copy the .pxplus-claude directory (PxPlus rules and documentation) cp -r .pxplus-claude ~/ ``` -------------------------------- ### PxPlus Object Usage and Lifecycle Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Demonstrates how to create, use, and manage PxPlus objects, including manual lifecycle control with NEW and DELETE, and automatic cleanup for program-level or object-level managed objects. It also clarifies property access and method calling conventions within a class. ```pxplus ! Manual object lifecycle management customer_mgr = NEW("CustomerManager") result = customer_mgr'find_customer("CUST001", 1) ! No CALL needed customer_mgr'customer_name$ = "ACME Corporation" name$ = customer_mgr'get_name$() DELETE OBJECT customer_mgr ! or DROP OBJECT customer_mgr ! Automatic cleanup when program exits auto_mgr = NEW("CustomerManager" FOR PROGRAM) ! Object will be automatically deleted when program ends result = auto_mgr'find_customer("CUST002") ! FOR OBJECT - only available within the creating object ! Used when creating objects inside another object child_obj = NEW("ChildClass" FOR OBJECT) ! Object will be automatically deleted when parent object is deleted ! IMPORTANT - Property access inside class: ! WRONG: THIS'property or LET THIS'property = value ! CORRECT: Direct access without prefix: property = value ! Call own methods: _obj'method() not THIS'method() ``` -------------------------------- ### Clone PxPlus Template Repository using Git Source: https://github.com/astecom/claude-pxplus-template/blob/master/README.md This command clones the PxPlus template repository from GitHub. It's the recommended method for obtaining the template files. After cloning, you navigate into the newly created directory. ```bash git clone https://github.com/Astecom/claude-pxplus-template.git cd claude-pxplus-template ``` -------------------------------- ### PxPlus Variable Declaration and Array Operations Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Covers PxPlus variable naming conventions (string suffix '$'), numeric types, and system/global variables. Demonstrates static, dynamic, and associative array declarations and basic operations like initializing all elements. ```pxplus ! String variables end with $ LOCAL customer_name$, address$, city$ ! Numeric variables have no suffix LOCAL count, total, average ! System/Global variables prefixed with % LET %BEDRIJF$ = "COMPANY001" LET %POOL_DIR$ = "/var/data/pool" ! Static arrays declared with DIM DIM customer_list$[100] ! 1-based array with 100 elements DIM sales_matrix[12,10] ! 12 rows, 10 columns ! Dynamic arrays - size determined at runtime DIM dynamic_array[*] REDIM dynamic_array[50] ! Resize to 50 elements ! Associative arrays use [key$] syntax DIM customer_data$[*][*] LET customer_data$["CUST001"] = "ACME Corp" LET customer_data$["CUST002"] = "TechStart Inc" retrieved_name$ = customer_data$["CUST001"] ! Array operations - access all elements DIM prices[10] LET prices[*] = 0 ! Set all elements to 0 LET prices{ALL} = 100 ! Alternative syntax ! LOCAL scope modifier for subroutines SUBROUTINE_LABEL: LOCAL DIM temp_array[20] ! Local to this subroutine LOCAL temp_var$, temp_count ! ... processing RETURN ``` -------------------------------- ### Configure PxPlus Executable Path Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Sets the path to the PxPlus executable, which is necessary for syntax checking and compilation within the Claude Code environment. The configuration is stored in a JSON file. ```bash # Set the PxPlus executable path using the custom slash command /set-pxplus-path /usr/local/bin/pxplus # For Windows users running Claude Code via WSL /set-pxplus-path /mnt/c/PxPlus/pvx.exe # Configuration is stored in ~/.pxplus-claude/pxplus-config.json ``` ```json { "pxplus_executable_path": "/usr/local/bin/pxplus", "description": "Configuration file for PxPlus development. Set pxplus_executable_path to the full path of your PxPlus executable." } ``` -------------------------------- ### PxPlus Documentation Lookup Structure Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Indicates the location of the PxPlus documentation within the project structure. This is a command-line instruction for accessing help files rather than executable code. ```bash # Documentation structure in ~/.pxplus-claude/pxplus-docs/ ``` -------------------------------- ### PxPlus Control Structures: Conditionals and Loops Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Illustrates various control flow patterns in PxPlus, including IF/THEN/ELSE statements (single and multi-line), SWITCH/CASE for multi-way branching, and FOR-NEXT and WHILE loops. It highlights specific PxPlus behaviors like loops executing at least once. ```pxplus ! IF/THEN/ELSE - single line IF count > 0 THEN PRINT "Found records" ELSE PRINT "No records" ! Multi-line IF (use curly braces, not backslashes) IF customer_type$ = "WHOLESALE" THEN { discount_rate = 0.15 payment_terms = 30 } ELSE { discount_rate = 0.05 payment_terms = 15 } ! Nested inline IF with TBL function status$ = TBL(balance > 0, "ACTIVE", "INACTIVE") ! SWITCH/CASE SWITCH order_status$ CASE "NEW" GOSUB PROCESS_NEW_ORDER BREAK CASE "PENDING", "REVIEW" GOSUB PROCESS_PENDING_ORDER BREAK CASE "COMPLETED" GOSUB ARCHIVE_ORDER BREAK DEFAULT GOSUB HANDLE_UNKNOWN_STATUS END SWITCH ! CRITICAL: PxPlus FOR-NEXT loops ALWAYS execute at least once! ! Guard loops that might not need to run: IF record_count > 0 THEN { FOR i = 1 TO record_count PRINT "Processing record ", i NEXT i } ! FOR loop with STEP FOR year = 2020 TO 2025 STEP 1 GOSUB PROCESS_YEAR NEXT year ! WHILE loop with BREAK and CONTINUE WHILE NOT(EOF(1)) READ (1, END=DONE) record$ IF record$ = "" THEN CONTINUE ! Skip empty records IF error_condition THEN BREAK ! Exit loop early GOSUB PROCESS_RECORD WEND DONE: ! CRITICAL: NO RETURN allowed inside FOR loops! ! This will cause runtime errors - use flags instead ``` -------------------------------- ### Configure PxPlus Executable Path in Claude Code Source: https://github.com/astecom/claude-pxplus-template/blob/master/README.md This command is used within Claude Code to set the file path to your PxPlus executable. Proper configuration is essential for Claude Code to perform syntax checking and compilation for PxPlus programs. ```text /set-pxplus-path ``` ```text /set-pxplus-path /usr/local/bin/pxplus ``` -------------------------------- ### PxPlus Object-Oriented Class Definition Source: https://context7.com/astecom/claude-pxplus-template/llms.txt Defines a modern PxPlus class named 'CustomerManager' with properties, methods (including overloaded functions), and lifecycle management hooks (ON_CREATE, ON_DELETE). It demonstrates private and hidden methods and correct property access within the class. ```pxplus DEF CLASS "CustomerManager" CREATE REQUIRED DELETE REQUIRED LIKE "BaseEntity" ! Optional inheritance ! Properties PROPERTY customer_id$ SET ERR PROPERTY customer_name$ SET ERR PROPERTY HIDE __internal_cache$ PROPERTY readonly_status$ SET ERR LOCAL record_count, last_error$ ! Public methods with overloading ! IMPORTANT: Functions MUST have a label after parentheses FUNCTION find_customer(id$)FIND_CUSTOMER_LABEL FUNCTION find_customer(id$, include_inactive)FIND_CUSTOMER_LABEL ! String functions need $ suffix FUNCTION get_name$()GET_NAME_LABEL FUNCTION get_count()GET_COUNT_LABEL ! Private method FUNCTION LOCAL validate_id(id$)VALIDATE_ID_LABEL ! Hidden method (not visible outside class) FUNCTION HIDE internal_cache_clear()CACHE_CLEAR_LABEL END DEF ! Object lifecycle methods ON_CREATE: LET record_count = 0 LET last_error$ = "" RETURN ON_DELETE: ! Cleanup code when object is deleted GOSUB CACHE_CLEAR_LABEL RETURN ! Method implementations (OUTSIDE class definition) FIND_CUSTOMER_LABEL: ENTER (id$), (include_inactive=0) ! Access properties directly (no THIS prefix) LET customer_id$ = id$ ! Implementation RETURN 1 GET_NAME_LABEL: RETURN customer_name$ GET_COUNT_LABEL: RETURN record_count VALIDATE_ID_LABEL: ENTER (id$) RETURN LEN(id$) > 0 CACHE_CLEAR_LABEL: LET __internal_cache$ = "" RETURN ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.