Search found 3056 matches

by Richard
Oct 05, 2007 21:40
Forum: Beginners
Topic: Variable = Equation
Replies: 9
Views: 2973

A bit like in this example. ' Pack an expression into an envelope, compile, run then get the result Dim As String expression = " 4 * atn(1) " ' pi, a test expression Dim As String program = $"C:\FreeBASIC\fbc.exe " ' check and edit path ' create a FreeBASIC program Open "scr...
by Richard
Oct 04, 2007 3:28
Forum: Beginners
Topic: Variable = Equation
Replies: 9
Views: 2973

Graph drawing programs are easy, but it is not easy to change a function without recompiling the source again. Take a look at my previous post at http://www.freebasic.net/forum/viewtopic.php?t=9478&highlight If the graphing program is only for you, just edit the function in the FBIde you are usi...
by Richard
Oct 04, 2007 0:01
Forum: Beginners
Topic: FreeBASIC Microcontroller port
Replies: 6
Views: 2832

I’m using the Microchip dsPIC30Fxxxx series. The internal architecture is optimised for C generated code. At present I hand code my inner loops in assembler and write the rest as crude assembler subroutines. The MPLAB C30 C compiler for the PIC chips is free, but the optimisation feature costs many ...
by Richard
Oct 03, 2007 23:12
Forum: General
Topic: BitSet Macro "segmentation violation" (Fixed)
Replies: 6
Views: 1513

The faulty system is a few hundred kilometres away, when I next get back there I will upgrade the FBc version and see if that was the problem. Thanks for now.
by Richard
Oct 03, 2007 11:07
Forum: General
Topic: BitSet Macro "segmentation violation" (Fixed)
Replies: 6
Views: 1513

BitSet Macro "segmentation violation" (Fixed)

The BitSet and the BitReset macros give this problem only when an integer array is used as an argument. This code works as expected on one machine but fails on another. I can work around it by using an integer variable instead of an array but I suspect there may be a bug lurking in there. Any ideas....
by Richard
Sep 23, 2007 1:07
Forum: General
Topic: freebasic.net blocked
Replies: 14
Views: 4570

There is a natural tendency for control to become total. Everything that is not compulsory must be forbidden. Creeping fascism grows until the economics collapse. Make sure that the “IT Department” find themselves first against the firewall, come the revolution. Do it now. Put in a purchase request ...
by Richard
Sep 21, 2007 2:27
Forum: General
Topic: is this a bug?
Replies: 8
Views: 1501

The code that evaluates hex is not checking to see if they are valid hex characters. x is being given a hex value of 1 or 33 dependent on case. Dim x As String Dim As Integer i For i = Asc("0") To Asc("z") x = "&h"+Chr(i) Print i, Chr(i),Val(x) Next i Sleep Is it a ...
by Richard
Sep 18, 2007 1:27
Forum: General
Topic: Does a set of points define a line? - [Solved]
Replies: 12
Views: 6355

Here is a major rewrite of my original. Instead of rr it gives you the RMS error measured perpendicular to the line of best fit. If RMS is zero then the fit is perfect. It is based on the original linear regression but RMS does a much better job than rr as an estimate of deviation from straightness....
by Richard
Sep 17, 2007 9:08
Forum: General
Topic: Does a set of points define a line? - [Solved]
Replies: 12
Views: 6355

Here is a simple linear regression that also computes the coefficient of determination, rr = r squared. If rr = 1.0000 then it is a perfectly straight line. As the fit gets worse rr falls towards zero. '============================================================= ' Linear Regression. y = ax+b, rr =...
by Richard
Sep 16, 2007 22:00
Forum: Beginners
Topic: 256 base division
Replies: 24
Views: 6659

Overflow and underflow are not tested in For:Next counter variables.
See: Cautions when using For:Next loops. http://www.freebasic.net/forum/viewtopic.php?t=7998
by Richard
Sep 15, 2007 23:11
Forum: Beginners
Topic: sudoku solver a way
Replies: 19
Views: 5170

The compiler writer creates and selects the bounds of the language. A translator has to program an envelope that contains the original compilers bounds but does not overlap where the bounds are not clear. The complexity of a general purpose translator is ultimately greater than that of writing a com...
by Richard
Sep 15, 2007 2:52
Forum: General
Topic: FB is 99.99999 compatible witg QB, has the same bugs ;)
Replies: 12
Views: 3780

Early interpreted BASICs used a linked list to handle the program text. The line number was followed by a link over that lines CrLf terminated code to the next line number. GOTO just ran along the list. You could hide lines by changing the links because the list function used the links but stopped a...
by Richard
Sep 14, 2007 23:01
Forum: Beginners
Topic: sudoku solver a way
Replies: 19
Views: 5170

Here is my Sudoku Assistant. It was written to help solve the difficult ones. It only does the routine book work so you still have to think. It also generates a text file that records its reason for decisions. Start with the nine rows in the nine data statements. Zero represents an unknown cell. It ...
by Richard
Sep 14, 2007 0:58
Forum: General
Topic: generate new functions at runtime?
Replies: 10
Views: 4293

Compile time is compile time, run time is run time and never the twain shall meet. You cannot run the .exe file created until the compiler closes it. This messy way gives you the ability to create runtime functions and use pipes or files to return results. ' Pack an expression into an envelope, comp...
by Richard
Sep 13, 2007 8:05
Forum: General
Topic: Will A Function Returns More Value In 0.19?
Replies: 12
Views: 2348

A user defined type can now be passed to and/or returned by a function.

Code: Select all

Type two
    count As Integer
    text As String
End Type

Function foo( Byval fred As two) As two
    foo = fred
End Function