|
Post by pandawdy on Jul 10, 2019 18:38:55 GMT -5
I have run LB on Windows 7 and Windows 10. Seems to work fine. How far back can we go with Windows and still be compatible with LB?
|
|
|
Post by Chris Iverson on Jul 10, 2019 19:00:47 GMT -5
Windows XP still works, for sure, and most likely Windows 2000, as well, as it's userland is very similar to Windows XP's.
Previous to that, I know previous versions of LB worked as far back as 95/98, but I'm not sure if that's still the case. It depends on the features used by both LB AND your program, and I seem to remember a breaking change was made in a recent version(maybe 4.5) that prevents it from running on earlier. I could be mistaken about that, though.
|
|
|
Post by Carl Gundel on Jul 11, 2019 15:51:57 GMT -5
Windows XP still works, for sure, and most likely Windows 2000, as well, as it's userland is very similar to Windows XP's. Previous to that, I know previous versions of LB worked as far back as 95/98, but I'm not sure if that's still the case. It depends on the features used by both LB AND your program, and I seem to remember a breaking change was made in a recent version(maybe 4.5) that prevents it from running on earlier. I could be mistaken about that, though. Liberty BASIC v4.5.1 seems to work fine back to Windows 98, but it might also work on Windows 95 or even Windows 3.1 with Win32 libraries. Not sure. Liberty BASIC 5 will work back to Windows 7, and possibly Vista. Can't say that LB 5.1 will run on Windows 7 though, though it might.
|
|
|
Post by mpranger on Jul 19, 2019 18:41:14 GMT -5
Will Liberty Basic 5 be able to save a horizontal quote and comma delimited aschii file? That would be the first thing I would like to see.
I don't think vertically. I think horizontally and so do spread sheets when they import aschii files which can line the fields up in columns.
I made a beautiful front end with option buttons to do data entry. Works perfect. I love it. Saves all kinds of time and effort. It's the reason I got LB. But I'm hung up trying to be able to use the data in a simple way. I shouldn't even be having to go thru all this. I should be on to using my program. Instead I'm bouncing the data off a spreadsheet to transpose it into a useful set of columns. It's making me crazy.
All the BASICs I have seen do this. It's such a common format. Why wouldn't LB do it?
|
|
|
Post by Carl Gundel on Jul 19, 2019 21:28:21 GMT -5
Will Liberty Basic 5 be able to save a horizontal quote and comma delimited aschii file? That would be the first thing I would like to see. I don't think vertically. I think horizontally and so do spread sheets when they import aschii files which can line the fields up in columns. I made a beautiful front end with option buttons to do data entry. Works perfect. I love it. Saves all kinds of time and effort. It's the reason I got LB. But I'm hung up trying to be able to use the data in a simple way. I shouldn't even be having to go thru all this. I should be on to using my program. Instead I'm bouncing the data off a spreadsheet to transpose it into a useful set of columns. It's making me crazy. All the BASICs I have seen do this. It's such a common format. Why wouldn't LB do it? Hi, I’m really not sure what you mean. Writing a file in any particular format isn’t usually too hard. Reading is usually harder. Give us an example of the format?
|
|
|
Post by Chris Iverson on Jul 19, 2019 22:17:28 GMT -5
I think he's looking to import and export directly to CSV files.
|
|
|
Post by mpranger on Jul 20, 2019 6:15:30 GMT -5
Yes Chris. Thank you. That's exactly what I mean.
|
|
|
Post by Rod on Jul 20, 2019 10:28:56 GMT -5
Liberty can handle this easily. The key is in understanding that a CRLF pair break the line. So your file is always more than data,data,data, if you have a file with three data items per record it should be stored like this data,data,data,CRLF data,data,data,CRLF
So each record has three data items which might be separated by a , but the record (or line) is terminated with CRLF. Liberty has commands to read a record/line and commands to read CSV.
If you give a practical example of your data set and a few example lines we can show you how to write the file and read the file. Over and above Liberty has RAF commands that make the whole task simpler.
The LBPE has example database code as well.
Start a new thread when you post.
EDIT Or, are you talking about presenting the data in a grid format? Is it the file storage or the presentation that is troublesome?
|
|
|
Post by tenochtitlanuk on Jul 21, 2019 4:17:06 GMT -5
Using csv files is indeed very easy in LB, (But with the caveat that you MAY need to watch whether the individual data items are enclosed in quotes.) I wrote a partly-finished 'database' using csv files interchangeable with a spreadsheet- Don't worry- the data is fictional, generated by an on-line data generator) Actually a current project was about doing a 'fuzzy search' of such csv files. If I think the whole file might contain 'UK' 'john'. Much quicker in LB rather than searching each field/column/row in a database manager or spreasdsheet- and it rates can 'closeness'. Actually that's where I got interested in this kind of fuzzy searching- spurred by a Byte magazine article from about 1980!! I'll probably add as a page on my website if I polish these up...
|
|
|
Post by tenochtitlanuk on Jul 21, 2019 4:39:07 GMT -5
Example output from fuzzy search of a csv file..
|
|
|
Post by tsh73 on Jul 22, 2019 7:23:53 GMT -5
John (tenochtitlanuk)
do you have some generic WRITECSV code? To match built-in INPUTCSV.
|
|
|
Post by tenochtitlanuk on Jul 23, 2019 8:38:58 GMT -5
I was using nothing directly equivalent, just old-style LB.. global variables; read first line which was known to be a title line; counting number of rows and terms in them.. relevant bits are ...
global recNum, numRows, numCols, fn$, firstRow$
filedialog "Choose csv datafile", "*.csv", fn$
open fn$ for input as #fileIn line input #fileIn, firstRow$ numCols =1 ' find number of columns
for f =1 to len( firstRow$) if mid$( firstRow$, f, 1) ="," then numCols =numCols +1 next f
while eof( #fileIn) =0 ' read each row and its column entries into an array line input #fileIn, row$
for k =0 to numCols item$ =word$( row$, k, ",") if item$ <>"" then data$( i, k) =item$ ': print item$, next k
i =i +1 scan 'print "" ' start a new row wend
numRows =i -1
sub saveFile a$ fileOut$ =word$( fn$, 1, ".") +"New.csv" open fileOut$ for output as #fOut #fOut firstRow$ +chr$( 13) +chr$( 10);
for i =1 to numRows for j =1 to numCols #fOut data$( i, j); if j <>numCols then #fOut ","; next j #fOut chr$( 13) +chr$( 10); next i close #fOut end sub
|
|
|
Post by tenochtitlanuk on Jul 23, 2019 14:39:06 GMT -5
|
|
|
Post by mpranger on Jul 27, 2019 8:11:36 GMT -5
Thanks for your ideas.
open "c:\new folder\wid2.txt" for append as #1
print #1,X$
print #1, pt
print #1, ft
print #1, spf
Gives me the wid2.txt file:
X pt ft spf
I'd like for it to be
"X", pt, ft, spf
|
|
|
Post by Rod on Jul 27, 2019 9:08:26 GMT -5
Then simply wrap the string X$ in quotes, chr$(34) and add the comma chr$(44) Also suppress the chr$(13) and chr$(10) that are added automatically to each print command. Do this by ending each intermediate print with a ; Leave the last print statement alone as it does not need a , and should end the line with chr$(13)+chr$(10).
Be sure csv format is really needed, since space isn't limited a RAF can be far simpler.
X$="Hello" pt=10 ft=20 spf=30
open "c:\new folder\wid2.txt" for output as #1 print #1, chr$(34);X$;chr$(34);chr$(44); print #1, pt;chr$(44); print #1, ft;chr$(44); print #1, spf close #1
open "c:\new folder\wid2.txt" for input as #1 line input #1,record$ print record$ close #1
|
|