PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: arrays, list in freebasic  (Read 126 times)

raymw

  • FireFly3 User
  • Junior FireFly Member
  • *
  • Posts: 70
arrays, list in freebasic
« on: January 07, 2018, 06:16:46 PM »

Having just come back to freebasic, and firefly, and being a bit confused.
At the moment I'm stuck on setting values into an array. I've a list of two columns of numbers (100 in total), and hoped I could wrap something like
Code: [Select]
  Dim Shared  xy(103) as Double  ={ 11.1820, 99.3837 ,
 -1.3761, 100.0000, 
 -13.9125, 99.0392,
lots more numbers...
23.5638, 97.2002,
 11.1820, 99.3837  }

The values were derived from elsewhere, and formatted into this list. I think the fb array wants all the numbers on the same line, which is going to be more tricky to recognize errors in them, during the 'honing/development process. Anyone any ideas on how to create this array, without too much hassle.
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8173
  • Windows 10
    • PlanetSquires Software
Re: arrays, list in freebasic
« Reply #1 on: January 07, 2018, 06:39:16 PM »

I believe you just need to end each line with the "line continuation" character which is an underscore.
Code: [Select]
Dim Shared  xy(103) as Double  ={ 11.1820, 99.3837 , _
 -1.3761, 100.0000, _
 -13.9125, 99.0392, _
lots more numbers...
23.5638, 97.2002, _
 11.1820, 99.3837  }
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

raymw

  • FireFly3 User
  • Junior FireFly Member
  • *
  • Posts: 70
Re: arrays, list in freebasic
« Reply #2 on: January 07, 2018, 08:41:48 PM »

Thanks, Paul. That did the trick. Any idea how i can purge my single brain cell of javscript, C#, Python, and all the other rubbish I have in there?
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8173
  • Windows 10
    • PlanetSquires Software
Re: arrays, list in freebasic
« Reply #3 on: January 07, 2018, 08:46:22 PM »

coffee. lots of coffee.  :)
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

raymw

  • FireFly3 User
  • Junior FireFly Member
  • *
  • Posts: 70
Re: arrays, list in freebasic
« Reply #4 on: January 13, 2018, 01:17:41 PM »

right, having completed my latest FF/FB programming exercise, is there an easy way, a parser/whatever, that will format the resulting code into something pretty, e.g. consistent line indents for blocks of code, and so forth?
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8173
  • Windows 10
    • PlanetSquires Software
Re: arrays, list in freebasic
« Reply #5 on: January 13, 2018, 01:54:06 PM »

There is nothing inside of FireFly itself that does automatic code formatting. It is not something that I have devoted any energy to in the past.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor