PlayBASIC Code Snippets - Function Mapper Function Searcher (2024-07-31)

Started by kevin, August 01, 2024, 10:00:35 AM

Previous topic - Next topic

kevin

PlayBASIC Code Snippets  Function Mapper  Function Searcher  (2024-07-31)

Welcome to PlayBasic coders! In this session, we explore a new example of source code. The script goes through the SS folder (source libraries) in PlayBasic, which contains various simple libraries in source code form. It creates a list of all available functions in these sources, outputting them as an HTML file.

The program loads multiple files, identifies functions within them, and displays the functions with their corresponding line numbers. Although initially intended for website work, the principle applies to both contexts.

The main steps include:

    Loading Files: The program loads files from a specified path, ignoring certain paths if necessary.

    Processing Files: It goes through the files to identify functions and their locations. This involves reading the file content, splitting it into lines, and analyzing each line for function definitions.

    Handling Special Cases: The script skips irrelevant lines like remarks (comments) and ensures it doesn't misinterpret commented-out functions as actual functions.

    Generating HTML: It uses a template to format the function list into an HTML document, making it easy to view and navigate.

This tool is designed to help you quickly find functions across multiple source files, addressing the common frustration of losing track of code. The generated HTML provides a clear overview of function locations, making it easier to manage and navigate your codebase.

This tool is shared on the forum for future reference and improvement. Feel free to customize it for your needs, and happy coding!




Related Source Code Links:

    - Compare Code

    - Compile and Run PlayBASIC GUI Project

    - PlayBASIC (CLASSIC) Project Loader / Source Merger Functions

    - Simple Text Menu

    - Syntax Highlight PlayBASIC source code as HTML





Download

kevin

PlayBASIC Code Snippets  Function Finder V0.07 (2024-08-10)


  This tool lets the user scan various BASIC source code files for functions and psub within them.  It supports PlayBASIC, Blitz BASIC, Dark BASIC , DarkBASIC PRO (DBPRO) and AppGameKit (AGK)



 




Download

    Source code attached bellow