Xbasic
Author: e | 2025-04-25
What is the Difference Between an Xbasic Module and an Xbasic Function Library? While an Xbasic Function Library and Xbasic Module may seem to be the same thing, the two Xbasic constructs have several key differences. Xbasic Scripts. Create Xbasic Scripts from the Web Projects Control Panel for testing code.
xbasic/XBasic-Manual-revised.docx at master dbetz/xbasic
A JSON object. This action, as well as the Query a SQL database to get hierarchical JSON data, is ideal for getting data from a database used to populate a List control, ViewBox, or other controls that require data to be in a JSON format.Query a SQL database to get hierarchical JSON dataGenerates the Xbasic to fetch records from multiple tables and merge the results into a nested JSON object where child records are included as an object array property of the parent record.Perform an UPDATE actionGenerates the Xbasic required to update one or more records in a table.Perform an INSERT actionGenerates the Xbasic required to add one or more records into a table.Perform a DELETE actionGenerates the Xbasic required to delete one or more records in a table.Xbasic Code GlossaryThe Glossary can be used to save Xbasic snippets that you frequently use. Snippets are saved with an abbreviation. When you type the abbreviation in the Xbasic editor, Alpha Anywhere automatically inserts the Xbasic snippet into your script.To access the Glossary, right-click in the Xbasic editor and select "Edit Glossary" from the context menu.The Xbasic snippet can be as long as you require. The special placeholder {ip} defines where to place the text insertion pointer after inserting the snippet. For example:DIM conn AS SQL::ConnectionIF (conn.open("::Name::AADemo-Northwind")) THEN {ip}ELSE TRACE.writeLn("Error opening connection" + conn.callResult.text,"SQL Log")END IFconn.close()Additional options are available for configuring whether or not the snippet should appear in the auto help while you are writing Xbasic as well as restrictions on where a snippet can be inserted.
XBasic - Browse /xbasic at SourceForge.net
= "SELECT FIRST 10 * FROM customers"DIM cnIn AS C = "::Name::AADemo-Northwind"result = sql_query(cnIn, sql)? result.error= .F.? result.json= [{"CustomerID" : "ALFKI"},{"CustomerID" : "ANATR"},{"CustomerID" : "ANTON"},{"CustomerID" : "AROUT"},{"CustomerID" : "BERGS"},{"CustomerID" : "BLAUS"},{"CustomerID" : "BLONP"},{"CustomerID" : "BOLID"},{"CustomerID" : "BONAP"},{"CustomerID" : "BOTTM"}]sql_insert()The sql_insert() function creates and executes an INSERT statement to add a new record to a table. The value to set in the field for a new record is defined as a JSON object of name-value pairs.DIM cn AS C = "::Name::AADemo-Northwind"DIM tablename AS C = "customers"DIM fieldsValuePairs AS C = sql_update() The sql_update() function creates and executes an UPDATE statement to modify an existing record in a table.DIM connection AS C = "::Name::AADemo-Northwind"DIM tablename AS C = "customers"DIM primaryKey AS C = "customerid"DIM primaryKeyValue AS C = "SMPL2"DIM fieldsValuePairs AS C = sql_count()The sql_count() function returns a count of the number of records matching a SQL query.DIM cn AS SQL::Connection? cn.open("::Name::AADemo-Northwind")= .T.DIM table AS CDIM fields AS CDIM filter AS Ctable = "customers"' * indicates all fields in the tablefields = "*"filter = "country='UK'"? sql_count(cn,table,fields,filter)Other Helpful ToolsXbasic SQL Actions Code GeneratorThe Xbasic SQL Actions Code Generator can be used to generate Xbasic for performing create, read, update, and delete (CRUD) operations against a data source. The Xbasic SQL Actions Code Generator is especially useful when writing server-side logic in web applications where data needs to be in a JSON format.The genie uses AlphaDAO connection strings to connect to the data source. To access the genie, right-click anywhere in the Xbasic editor to open the context menu. Then, select "Genies..." > "Xbasic SQL Actions Code Generator..." to open the genie.The genie generates Xbasic for the actions listed below:Query a SQL database to get JSON dataGenerates the Xbasic to fetch one or more records from a table and convert the query result intoXBasic - Browse /xbasic/6.2.3 at SourceForge.net
With VB C++ or Delphi applications. High performance solution comes with FREE SDK and Consulting servicesPrice: $475.00, Rating: 6, Downloads: 105 Download OneClick Video Converter 10.0.1.82With OneClick Video Converter you can convert almost all video and audio formats, such as 3GP, WMV, RM, MP4, MPEG, SWF, AVI, MOV, AAC, AC3, MP2, MP3, AMR, WAV, VOB and ASF with just a few clicks.Price: $25.99, Rating: 10, Downloads: 95 Download Arclab File IO/System Toolbox 2.0cArclab FileIO/System Toolbox is a set of easy to use but powerful functions for File, Folder, Shell, Windows API and System operations and for gathering informations.Price: $69, Rating: 10, Downloads: 70 Download User Rating Rating: 2.2 out of 5 Based on 13 ratings. 13 user reviews. Currently 2.15 out of 512345 Software Categories Audio & MultimediaBusinessCommunicationsDesktopDevelopment Active XBasic, VB, VB DotNetC / C++ / C#Compilers and InterpretersComponents and LibrariesDebuggingDelphiHelp ToolsInstall and SetupManagement and DistributionSource EditorsEducationGames & EntertainmentGraphic AppsHome and HobbyNetwork & InternetSecurity and PrivacyServersSystem UtilitiesWeb Development Top Downloads. What is the Difference Between an Xbasic Module and an Xbasic Function Library? While an Xbasic Function Library and Xbasic Module may seem to be the same thing, the two Xbasic constructs have several key differences. Xbasic Scripts. Create Xbasic Scripts from the Web Projects Control Panel for testing code. 1. What is XBasic? XBasic is a project aimed at developing an interpreter for a programming language called XBasic. It involves the creation of a parser, lexer, and executor for XBasic code, allowing users to write and execute XBasic programs. 2. What features does XBasic offer?Downloading File /xbasic/xbasic--A-windows .zip
HTML Form. In addition, you can also use several special 'Alpha Five controls' such as tab controls, accordion controls, conditional objects, etc. This video shows how you can place an Accordion control in an HTML Form supercontrol. It also shows how you can define event handlers for the events in the HTML Form using Xbasic. We show how you can handle the onclick event for a hyperlink using an Xbasic function. Watch video | In this next video we show how you can put a button in the accordion control and then use standard CSS to style the button. An accordion control is like a list with sections. Opening one section can automatically close the currently open section. Accordions are a great way to present categorized menu choices to a user. We also show how you can use all of the built-in images that come with Alpha Five to decorate your forms. Watch video | In this video we show the full power of the HTML Form supercontrol. This video shows off several features of the HTML Form supercontrol such as accordions, tabs, dynamic lists, Xbasic event handling etc. Unlike the previous two examples which showed the HTML Form supercontrol in the context of a Form, this example shows the HTML Form in an Xdialog.The source code for this example is available in the sample 'Learning Xdialog' database that ships with Version 9. Watch video (This video does not have audio) | Hyperlink SupercontrolThe Hyperlink Supercontrol allows you to placeXbasic Guide - An introduction to Xbasic - Alpha Software
Xbasic GuideWorking With SQL Data Using XbasicIN THIS PAGEAlphaDAO ConnectionsThe SQL NamespaceConnecting to the DatabaseExecuting a QueryProcessing the Query ResultsClosing ConnectionsCreating Queries with ArgumentsConverting Query Results to Other FormatsTransactionsWriting Portable SQL QueriesXbasic SQL Helper FunctionsOther Helpful ToolsMost applications build in Alpha Anywhere communicate with a database -- such as MySQL or SQL Server. Xbasic provides powerful commands for working with data in a SQL database. Understanding how to use these commands enables you to build complex workflows in your applications beyond what Alpha Anywhere provides out of the box.AlphaDAO ConnectionsAlpha Anywhere communicates with a database using an AlphaDAO connection string. AlphaDAO stands for "Alpha Anywhere Data Access Object". AlphaDAO is an interface through which you access data stored in SQL, NoSQL, DBaaS, SaaS, and other data sources, including static JSON and OData (Open Data Protocol) APIs. There are several methods for creating a connection string, including Ad-hoc and Named Connections.AlphaDAO connections can be created using the AlphaDAO Connections dialog, found under the Edit menu on the Web Projects Control Panel.Named connection strings are created and managed using the AlphaDAO connections dialog. For the SQL examples in this section, we will use the Microsoft Access Northwind database. Alpha Anywhere includes a pre-defined connection string, "AADemo-Northwind", for communicating with the Northwind database. This connection string can be added to your workspace by clicking the "Create 'AADemo-Northwind' demo connection string" link at the bottom of the AlphaDAO Connections dialog.Follow the instructions to create the connection string and close the AlphaDAO Connections dialog after the AADemo-Northwind named connection has been created.The SQL NamespaceThe SQL namespace is a collection of Xbasic classes used for communicating with and performing operations on a database or any system of record that you can connect to with an AlphaDAO connection. The core SQL namespace classes used to interact withDownload xbasic-6.2.3-win32.zip (XBasic) - SourceForge
Data in a database. The actions available in the genie are shown in the image below.The genie dynamically creates the SQL query based on the selections you make on the tabs for selecting the tables, columns, filters, and sort criteria required in your query.Only the first 100 results for a query appear in the Preview pane. Queries can be converted between portable SQL (the default query format) and native SQL and copied any time using the Copy to Clipboard feature. Alpha Anywhere also keeps track of the queries you create in the SQL History, which can be used to retrieve past queries quickly.SQL Native Syntax dialog.SQL History dialog.Xbasic SQL Helper FunctionsMany functions exist for performing common SQL queries using Xbasic. Internally, these functions use the SQL objects we've discussed previously to connect to and execute commands on a SQL database. The examples below show some of the more common SQL helper functions used in Xbasic scripts. You can learn more about these functions as well as other SQL helper functions in the Alpha Anywhere documentation. See SQL Helper Functions for more information.sql_lookup()The sql_lookup() function retrieves a value from a table.DIM connection AS C = "::Name::AADemo-Northwind"DIM table AS C = "customers"DIM result_expression AS C = "concatenate(city,' - ',contactname)"DIM filter AS C = "customerid = :whatcustomerid"DIM args AS SQL::argumentsargs.set("whatcustomerid","ALFKI")? sql_lookup(connection,table,filter,result_expression,args)= "Berlin - Maria Anders"sql_records_get()The sql_records_get() function retrieves one or more records and returns it as a character list.DIM connection AS C = "::Name::AADemo-Northwind"DIM table AS C = "customers"DIM result_expression AS C = "concatenate(city,' - ',contactname)"DIM filter AS C = "city = 'London'"? sql_records_get(connection,table,filter,result_expression)= London - Thomas HardyLondon - Victoria AshworthLondon - Elizabeth BrownLondon - Ann DevonLondon - Simon CrowtherLondon - Hari Kumarsql_query()The sql_query() creates and executes a SQL query to select records from a SQL database.DIM result AS PDIM sql AS C. What is the Difference Between an Xbasic Module and an Xbasic Function Library? While an Xbasic Function Library and Xbasic Module may seem to be the same thing, the two Xbasic constructs have several key differences. Xbasic Scripts. Create Xbasic Scripts from the Web Projects Control Panel for testing code. 1. What is XBasic? XBasic is a project aimed at developing an interpreter for a programming language called XBasic. It involves the creation of a parser, lexer, and executor for XBasic code, allowing users to write and execute XBasic programs. 2. What features does XBasic offer?Comments
A JSON object. This action, as well as the Query a SQL database to get hierarchical JSON data, is ideal for getting data from a database used to populate a List control, ViewBox, or other controls that require data to be in a JSON format.Query a SQL database to get hierarchical JSON dataGenerates the Xbasic to fetch records from multiple tables and merge the results into a nested JSON object where child records are included as an object array property of the parent record.Perform an UPDATE actionGenerates the Xbasic required to update one or more records in a table.Perform an INSERT actionGenerates the Xbasic required to add one or more records into a table.Perform a DELETE actionGenerates the Xbasic required to delete one or more records in a table.Xbasic Code GlossaryThe Glossary can be used to save Xbasic snippets that you frequently use. Snippets are saved with an abbreviation. When you type the abbreviation in the Xbasic editor, Alpha Anywhere automatically inserts the Xbasic snippet into your script.To access the Glossary, right-click in the Xbasic editor and select "Edit Glossary" from the context menu.The Xbasic snippet can be as long as you require. The special placeholder {ip} defines where to place the text insertion pointer after inserting the snippet. For example:DIM conn AS SQL::ConnectionIF (conn.open("::Name::AADemo-Northwind")) THEN {ip}ELSE TRACE.writeLn("Error opening connection" + conn.callResult.text,"SQL Log")END IFconn.close()Additional options are available for configuring whether or not the snippet should appear in the auto help while you are writing Xbasic as well as restrictions on where a snippet can be inserted.
2025-04-24= "SELECT FIRST 10 * FROM customers"DIM cnIn AS C = "::Name::AADemo-Northwind"result = sql_query(cnIn, sql)? result.error= .F.? result.json= [{"CustomerID" : "ALFKI"},{"CustomerID" : "ANATR"},{"CustomerID" : "ANTON"},{"CustomerID" : "AROUT"},{"CustomerID" : "BERGS"},{"CustomerID" : "BLAUS"},{"CustomerID" : "BLONP"},{"CustomerID" : "BOLID"},{"CustomerID" : "BONAP"},{"CustomerID" : "BOTTM"}]sql_insert()The sql_insert() function creates and executes an INSERT statement to add a new record to a table. The value to set in the field for a new record is defined as a JSON object of name-value pairs.DIM cn AS C = "::Name::AADemo-Northwind"DIM tablename AS C = "customers"DIM fieldsValuePairs AS C = sql_update() The sql_update() function creates and executes an UPDATE statement to modify an existing record in a table.DIM connection AS C = "::Name::AADemo-Northwind"DIM tablename AS C = "customers"DIM primaryKey AS C = "customerid"DIM primaryKeyValue AS C = "SMPL2"DIM fieldsValuePairs AS C = sql_count()The sql_count() function returns a count of the number of records matching a SQL query.DIM cn AS SQL::Connection? cn.open("::Name::AADemo-Northwind")= .T.DIM table AS CDIM fields AS CDIM filter AS Ctable = "customers"' * indicates all fields in the tablefields = "*"filter = "country='UK'"? sql_count(cn,table,fields,filter)Other Helpful ToolsXbasic SQL Actions Code GeneratorThe Xbasic SQL Actions Code Generator can be used to generate Xbasic for performing create, read, update, and delete (CRUD) operations against a data source. The Xbasic SQL Actions Code Generator is especially useful when writing server-side logic in web applications where data needs to be in a JSON format.The genie uses AlphaDAO connection strings to connect to the data source. To access the genie, right-click anywhere in the Xbasic editor to open the context menu. Then, select "Genies..." > "Xbasic SQL Actions Code Generator..." to open the genie.The genie generates Xbasic for the actions listed below:Query a SQL database to get JSON dataGenerates the Xbasic to fetch one or more records from a table and convert the query result into
2025-04-10HTML Form. In addition, you can also use several special 'Alpha Five controls' such as tab controls, accordion controls, conditional objects, etc. This video shows how you can place an Accordion control in an HTML Form supercontrol. It also shows how you can define event handlers for the events in the HTML Form using Xbasic. We show how you can handle the onclick event for a hyperlink using an Xbasic function. Watch video | In this next video we show how you can put a button in the accordion control and then use standard CSS to style the button. An accordion control is like a list with sections. Opening one section can automatically close the currently open section. Accordions are a great way to present categorized menu choices to a user. We also show how you can use all of the built-in images that come with Alpha Five to decorate your forms. Watch video | In this video we show the full power of the HTML Form supercontrol. This video shows off several features of the HTML Form supercontrol such as accordions, tabs, dynamic lists, Xbasic event handling etc. Unlike the previous two examples which showed the HTML Form supercontrol in the context of a Form, this example shows the HTML Form in an Xdialog.The source code for this example is available in the sample 'Learning Xdialog' database that ships with Version 9. Watch video (This video does not have audio) | Hyperlink SupercontrolThe Hyperlink Supercontrol allows you to place
2025-03-27Xbasic GuideWorking With SQL Data Using XbasicIN THIS PAGEAlphaDAO ConnectionsThe SQL NamespaceConnecting to the DatabaseExecuting a QueryProcessing the Query ResultsClosing ConnectionsCreating Queries with ArgumentsConverting Query Results to Other FormatsTransactionsWriting Portable SQL QueriesXbasic SQL Helper FunctionsOther Helpful ToolsMost applications build in Alpha Anywhere communicate with a database -- such as MySQL or SQL Server. Xbasic provides powerful commands for working with data in a SQL database. Understanding how to use these commands enables you to build complex workflows in your applications beyond what Alpha Anywhere provides out of the box.AlphaDAO ConnectionsAlpha Anywhere communicates with a database using an AlphaDAO connection string. AlphaDAO stands for "Alpha Anywhere Data Access Object". AlphaDAO is an interface through which you access data stored in SQL, NoSQL, DBaaS, SaaS, and other data sources, including static JSON and OData (Open Data Protocol) APIs. There are several methods for creating a connection string, including Ad-hoc and Named Connections.AlphaDAO connections can be created using the AlphaDAO Connections dialog, found under the Edit menu on the Web Projects Control Panel.Named connection strings are created and managed using the AlphaDAO connections dialog. For the SQL examples in this section, we will use the Microsoft Access Northwind database. Alpha Anywhere includes a pre-defined connection string, "AADemo-Northwind", for communicating with the Northwind database. This connection string can be added to your workspace by clicking the "Create 'AADemo-Northwind' demo connection string" link at the bottom of the AlphaDAO Connections dialog.Follow the instructions to create the connection string and close the AlphaDAO Connections dialog after the AADemo-Northwind named connection has been created.The SQL NamespaceThe SQL namespace is a collection of Xbasic classes used for communicating with and performing operations on a database or any system of record that you can connect to with an AlphaDAO connection. The core SQL namespace classes used to interact with
2025-04-03May look like this:DIM sqlSelect AS C = "SELECT * FROM Customers WHERE Country = 'Spain'"If you wanted to give the user a choice as to what country to get customer data for, however, you will need to define the SQL WHERE clause using arguments in place of static values.Arguments allow you to define a SQL statement where parts of the statement are determined dynamically. For example, the above SELECT statement can be rewritten using SQL arguments as follows:country = "Spain"DIM sqlSelect AS C = "SELECT * FROM Customers Where Country = :Country"DIM args AS SQL::Argumentsargs.set("Country",country)The country variable represents the data we received from the user. In a web application, this data may be passed to the Xbasic script via an Ajax callback or session variable.'Read the country from the data submitted'to this Ajax callback function:country = e.dataSubmitted.selectedCountryYou might be wondering why we did not use string concatenation to create the query. If the query is populated with data gathered from the user, you risk exposing your database to common SQL vulnerabilities if you do not pre-process the data submitted by the user before using it in a query. Values set in SQL::Arguments are sanitized before being used in SQL statements, protecting you from SQL Injection attacks and other common SQL hacks. Because of this, you should always use arguments in SQL queries.Converting Query Results to Other FormatsThe ResultSet includes methods for converting the query results to another data format, including character lists, property arrays, JSON, XML, CSV, and Excel.Converting a ResultSet to an Xbasic VariableIt's sometimes easier to deal with a result set by saving the data into an Xbasic Variable, such as a character list or property array. The SQL::ResultSet has several methods for converting a result set to a variable: toString() and toPropertyArray().The toString() method formats the
2025-04-21