Print_Console()
Syntax: _Print_Console(p1, p2, ..., p20)
Purpose: Sends output to the Corona Simulator's console. This is invaluable for debugging, monitoring variables, or creating custom logging. It can also send data to the Remote Console if it has been enabled.
Parameters:
This function accepts up to 20 parameters (p1 through p20), which can be strings, numbers, or other data types.
Examples:
Adding/Updating
Watches:
Use commands like Print_Console("**Add
Watch [variable_name]**")
to monitor specific variables in real-time within the console.
Change their values on the fly with Print_Console("**Update
Watch [variable_name]**", new_value)
.
Deleting
Watches:
Clear tracked variables with Print_Console("**Delete
Watches**")
Print_Console_Array()
Syntax: _Print_Console_Array(array)
Purpose: Dumps the contents of an array (up to four dimensions) to the console. This is handy for inspecting the data structures within your app.
Print_Console_Array_v2()
Syntax: _Print_Console_Array_v2(Table_to_Print)
Purpose: Provides even more flexibility by printing the contents of a table of any dimension to the console. Great for complex objects or nested data structures.
Print_Console_Connection()
Syntax: _Print_Console_Connection(ip_address, port_number)
Purpose:
Allows you to redirect the output of Print_Console
to a different IP address and port. This is essential for using the
Remote Console feature for debugging on real devices.
Parameters
ip_address: (Required) The IP address of the machine running the Remote Console.
port_number: (Optional) The port the Remote Console is listening on (defaults to 1235).
Print_Web_Console()
Syntax: _Print_Web_Console(console_code, console_message)
Purpose: A specialized logging function that stores messages in a web-accessible console table. Useful for debugging server-side scripts or situations where the device console may not be easily accessible.
Parameters:
console_code: A unique code to identify the message.
console_message: The message data.
Important:
Requires
a _Server_URL
.
variable pointing to your project's admin domain
Retrieve
messages using the URL
https://domain.com/Get_Console.asp?console_code=xxx
Messages are deleted from the table once retrieved.
Of course! Let's focus on the Lu C Studio command for retrieving your Remote Console App ID:
Get_Remote_Console_AppId()
Syntax: _Get_Remote_Console_AppId()
Purpose: This function returns the unique App ID used specifically for handling Remote Console output. This ID is crucial when you want to view debugging output from your app running on a real device.
Behavior:
Returns a String: The App ID will be a string of characters, which you'll need to use in conjunction with the Remote Console to connect to your app's debug output.