Comma Separated Value files

Discuss the Firewing language

Comma Separated Value files

Postby roger » Sat Sep 14, 2013 5:15 pm

Hi,

This possibly has a simple explanation, but right now I cannot find it.

I am trying to include large .wav files into a Firewing program.

If I declare them as a const array this compiles
const constarray() as integer = { 1, 3, 8, 6, 5, 7, 4, 8, 10, 50, 80000}

However, If I have a large array and have to split the file over several line breaks, the compiler throws an error thus
const constarray() as integer = { 1, 3, 8, 6, 5, 7, 4, 8,
10, 50, 80000}

I know that I can use the continuation character _ for splitting a statement over several lines, but the real problem is that I have to use a comma separated value file format from a file synthesis program which is normally formatted as 8 words per line, which can be upto 1000 bytes long.
If I have to edit the whole file with continuation characters this would be a huge task.

Also, is it possible to use include for a constant array, ie include "array.bas", or is there another way to include a data file in a program?

Any suggestions appreciated.

Roger
roger
 
Posts: 33
Joined: Tue Dec 11, 2012 12:41 pm

Re: Comma Separated Value files

Postby David John Barker » Sun Sep 15, 2013 9:01 am

You have to use the line continuation character "_" - for examples on how to use constant array include files, see one of the font sample files provided in the last installation.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Comma Separated Value files

Postby Jerry Messina » Sun Sep 15, 2013 1:13 pm

Any thoughts on implementing the "implicit line continuation" feature found in vb.net 2010?
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: Comma Separated Value files

Postby richardb » Mon Sep 16, 2013 9:34 am

Maybe you could use notpad++

use search and replace using extended mode

search for \r replace with _\r
richardb
 
Posts: 63
Joined: Thu Aug 01, 2013 10:40 am

Re: Comma Separated Value files

Postby David John Barker » Mon Sep 16, 2013 3:54 pm

> Any thoughts on implementing the "implicit line continuation"

It would be a nice feature, if I get time I will take a look...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Comma Separated Value files

Postby David John Barker » Mon Sep 16, 2013 6:31 pm

I've just tried some tests and I think "implicit line continuation" could be very easily done. I will try and get a BETA posted sometime tomorrow...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Comma Separated Value files

Postby roger » Tue Sep 17, 2013 6:29 am

Thank you David, that would be fantastic.

Roger
roger
 
Posts: 33
Joined: Tue Dec 11, 2012 12:41 pm

Re: Comma Separated Value files

Postby David John Barker » Tue Sep 17, 2013 11:25 am

You can download a BETA which implements implicit line continuation:

http://www.firewing.info/pmwiki.php?n=Firewing.Download

an overview of this new feature can be found here:

http://www.firewing.info/pmwiki.php?n=Reference.ImplicitLineContinuation
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: Comma Separated Value files

Postby Jerry Messina » Tue Sep 17, 2013 11:29 am

That looks great!

Seems to cover the most common places where it would come in handy. Have to take it for a spin...
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: Comma Separated Value files

Postby David John Barker » Tue Sep 17, 2013 11:36 am

> Seems to cover the most common places where it would come in handy

Yes, I think it does..

> Have to take it for a spin...

Please don't break it Jerry...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Next

Return to Language

Who is online

Users browsing this forum: No registered users and 6 guests

x