|
Post by norman on Jan 8, 2008 16:58:10 GMT -5
I am trying to convert one of my Liberty Basic programs to RunBasic, and I have hit a problem.
My program makes extensive use of the RESTORE command to read specific items of DATA. I RESTORE to whichever branch label is appropriate. However, it seems that in RunBasic, the RESTORE command does not recognize branch labels.
Is this something that will be added later, or do I need to change the structure of my program?
Norman
|
|
|
Post by rabaggett on Jan 9, 2008 18:50:39 GMT -5
WARNING.. a complete RunBasic noob is posting...
But I code with several languages...
I have always ended up regretting it when I've hard-coded data. Putting data into a file and reading it as needed takes more work, but makes your code more portable.
In this case, several files could represent each branch label, or maybe a single random-access file... Or even an INI-like file with keys for each 'branch label'.
|
|
|
Post by Jerry Muelver on Jan 9, 2008 19:14:36 GMT -5
I would have to see the DATA statements, but I suspect the problem can be handled with a single string, delimited with markers like "|", from which you can retrieve section x by using word$(datastr$,x,"|")
|
|
|
Post by billw on Jan 9, 2008 19:16:58 GMT -5
Rabaggett, your advice on putting data in support files is a good idea. But why re-invent the wheel when XML parsing is supported out-of-the-box?
Norman, the RB docs don't say anything about restoring from branch labels, so I'd guess it isn't supported. Carl?
- Bill
|
|
|
Post by Alyce on Jan 9, 2008 19:44:58 GMT -5
Norman, the RB docs don't say anything about restoring from branch labels, so I'd guess it isn't supported. Carl? - Bill Not supported. I think the native SQLite capabilities are more useful than data/read/restore. It just takes some getting used to. (It took me a while to get the feel of it.) You can have multiple database files, or multiple tables within a file. That accomplishes the same thing as restoring to a branch label. There's an SQLite tutorial in the helpfile of RBPersonal, and there's a little on the wiki, here: runbasic.wikispaces.com/SqliteMike Bradbury's SQLite demo: runbasic.wikispaces.com/No+Frills+SQL+DemoSQLite is really great, too, because of the built-in rendering capabilities.
|
|
|
Post by norman on Jan 10, 2008 4:16:28 GMT -5
Thanks for the replies, it looks as though I will need to take a look at this SQLite. Until now, I have avoided this as I am now finding it more difficult to understand new procedures, while I am still quite comfortable with procedures that I learne years ago.
Thanks again, I'm off to check out SQLite.
Norman
|
|
|
Post by colinmac on Jan 10, 2008 13:13:01 GMT -5
Norman,
SQLite is a pussycat! Go for it.
Colin
|
|