BuckshotPlusPlus
  • 🤝Getting started
    • What is BuckShotPlusPlus?
    • Install
  • 📺Video tutorials
    • Getting started with bpp
    • How to use reusable components
    • How to use events
  • 👔Data types
    • Variables
    • Arrays
    • View
    • Data
    • Page
    • Event
  • 🤓The basics
    • Comments
    • Include
    • String concatenation
    • Conditions
    • Sessions
    • Static site export
  • 🔍SEO
    • Sitemap.xml
    • Meta tags
  • Advanced use
    • CSS Properties
Powered by GitBook
On this page
  • How it works
  • Declaring arrays
  • Use cases
  • Important notes

Was this helpful?

Export as PDF
  1. Data types

Arrays

Learn how to use arrays in BuckShotPlusPlus

PreviousVariablesNextView

Last updated 1 year ago

Was this helpful?

Arrays in are data structures that allow you to store multiple values in a single . They are particularly useful when you want to group related data together or when you need to manage a collection of items, such as .

How it works

Declaring arrays

In , arrays are declared using square brackets []. Each item in the array is separated by a comma. Arrays can be used in various places within your code, such as assigning multiple to the content of another .

Here's a basic example:

view MyView{
    content = [Child1, Child2]
}

In this example, the content property of the MyView is assigned an array containing two : Child1 and Child2.

Use cases

  1. Grouping Related Data: Arrays allow you to group related data together, making your code more organized and easier to manage.

Important notes

  • Always ensure that the items you place in an array are of a consistent type or are expected by the property or function you're assigning the array to.

  • Be mindful of the order of items in an array, as this can affect how they are displayed or processed.

  • While arrays are powerful, ensure you use them appropriately and avoid unnecessary complexity in your code.

👔
BuckshotPlusPlus
variable
views
BuckshotPlusPlus
views
view
view
views