Search found 1015 matches

by jevans4949
Mar 17, 2018 1:43
Forum: Community Discussion
Topic: FreeBASIC and the Raspberry Pi ?
Replies: 69
Views: 4615

Re: FreeBASIC and the Raspberry Pi ?

Thank you all for your responses which I can refer to when I start trying to get it all going. Still have to buy a monitor and HDMI cable. . You may find it easier / cheaper to buy a second-hand TV with an HDMI socket. You also get a spare TV set. If in the UK, rush to your local Maplin store for t...
by jevans4949
Nov 25, 2017 23:34
Forum: Beginners
Topic: Copy FB .csv file to Base table
Replies: 3
Views: 505

Re: Copy FB .csv file to Base table

Don't know if it helps, but you can covert a whole .csv file into a new LIbre-Office table. From the Libre-Office Menu bar select File/New/Database; on the popup screen, select the 3rd button - "Connect to existing database, and select "Spreadsheet" from the menu box below it. But the...
by jevans4949
Oct 28, 2017 23:33
Forum: General
Topic: A True False conundrum [Solved]
Replies: 19
Views: 931

Re: A True False conundrum [Solved]

There's a book with Terry Pratchett as co-author which has the introduction:

This is a true account of the life of William Shakespeare.
But only for certain values of True.
by jevans4949
Oct 28, 2017 17:34
Forum: General
Topic: A True False conundrum [Solved]
Replies: 19
Views: 931

Re: A True False conundrum [Solved]

I occasionally get a warning that I may be cracking up and these warnings are more common than ever they used to be. Needless to say that I am pleased to learn that on this occasion it was a false positive. <Ha,ha> You don't have to be mad to use FreeBasic, but it helps! The Boolean type is a relat...
by jevans4949
Oct 28, 2017 15:29
Forum: General
Topic: A True False conundrum [Solved]
Replies: 19
Views: 931

Re: A True False conundrum

Sub Test() Static As Boolean FirstInstance = TRUE Print CUByte(firstinstance) Print CUByte(TRUE) If FirstInstance Then Print "First Instance" FirstInstance = False Else Print "Second Instance" firstinstance = true End If End Sub Test Test Test Sleep If you run the above, it appe...
by jevans4949
Sep 06, 2017 22:10
Forum: Libraries
Topic: FLTK C for FreeBASIC Jan 09, 2017
Replies: 195
Views: 26643

Re: FLTK C for FreeBASIC Jan 09, 2017

Joshy (or anybody), sorry to be a pain. I'm writing a program which needs a "pop-up" window on processing the first data record of each of 2 files. 1. Does FLTK-C provide access to the C++ destructors? I would like to get rid of this window once I've got the user input (and copied it into ...
by jevans4949
Jun 25, 2017 21:24
Forum: Libraries
Topic: any lib to read excel XLS/XLSX files?
Replies: 9
Views: 1442

Re: any lib to read excel XLS/XLSX files?

For XLS, there is a thing called disphelper, with include files in the Feebasic distribution. Trouble is, I've found no documentation (apart from the code itself). I recently looked into writing something myself, but got diverted into something else. Microsoft have now published the format of COM fi...
by jevans4949
Jun 11, 2017 17:29
Forum: Beginners
Topic: Terrible Bugs
Replies: 13
Views: 996

Re: Terrible Bugs

@sancho2: You are correct in saying you can't PUT a string array. It's a long time since I tried it. You can put a TYPE containing variable string descriptors; you get a warning from the compiler if you do, but it still runs. And as you illustrated, If you want to emit the actual data, you have to ...
by jevans4949
Jun 10, 2017 9:16
Forum: Beginners
Topic: Terrible Bugs
Replies: 13
Views: 996

Re: Terrible Bugs

@owen: In the normal course of events, for the sake of speed, FreeBasic doesn't check that array subscripts are in the valid range, so your last example will stomp over memory in an unpredicatble way. EDIT: you may get a segment violation error at runtime if you try to write outside outside the mem...
by jevans4949
Jun 10, 2017 0:03
Forum: Beginners
Topic: Terrible Bugs
Replies: 13
Views: 996

Re: Terrible Bugs

@owen: The array descriptor (a data type internal to the compiler, includes a "virtual origin", which is a pointer to the theoretical address of array(0,0,0). To simplify, if you put "DIM X (2 TO 4) AS INTEGER", and the compiler allocates 12 bytes for the content at &HC000, ...
by jevans4949
Jun 07, 2017 9:33
Forum: Beginners
Topic: uInteger
Replies: 9
Views: 632

Re: uInteger

@HillbillyGeek: Also note that if you set up a loop in the form: Dim u as ubyte For u = 0 to 255 'Whatwever Next u ... the loop will never end. At the end of each iteration, 1 is added to u, and after 255 it rolls over to 0, and starts all over again. There are ways round this. Most obvious is to p...
by jevans4949
Jun 07, 2017 9:20
Forum: Beginners
Topic: Terrible Bugs
Replies: 13
Views: 996

Re: Terrible Bugs

1. Initialise i to 3 (or some value) before using it to DIM arrays.
2. Use REDIM to define your arrays with dynamic sizes.
by jevans4949
May 24, 2017 19:44
Forum: Beginners
Topic: Saving output to a file
Replies: 11
Views: 950

Re: Saving output to a file

That is not safe coding of imposing a file number (as #94) to bind to a disk file (with OPEN, PRINT #, ...). The better is to request a file number to the system (just before the 'OPEN' code line), by using the keyword FREEFILE : dim as integer f = freefile open "answers.txt" for output a...
by jevans4949
May 20, 2017 17:52
Forum: Beginners
Topic: Saving output to a file
Replies: 11
Views: 950

Re: Saving output to a file

If it's just plain text output, you could modify your program to print the results you need to a .txt file, which you could print either from Notepad or FBEdit, or paste the content into your word processor. open "answers.txt" for output as #94 print #94,"my answer" close #94
by jevans4949
May 05, 2017 16:16
Forum: Beginners
Topic: Can functions return arrays?
Replies: 40
Views: 2313

Re: Can functions return arrays?

@evil_twin: In case it's what you need to do, you can declare a dynamic array using ReDim, and resize it in your function using ReDim again. Trival demo: Sub resizer(hisarray()As integer) ReDim hisarray(0 To 99) hisarray(99) = 42 End Sub reDim myarray(0) As Integer resizer(myarray()) Print LBound(my...

Go to advanced search