Search found 1340 matches

by jofers
Sep 09, 2008 13:24
Forum: Beginners
Topic: Pen Position
Replies: 9
Views: 1126

The Wiki's not perfect, but the graphics functions are designed to be backwards compatible with QB:
http://www.qbasicnews.com/qboho/qckadvr.pointr.shtml
by jofers
Sep 09, 2008 6:14
Forum: Beginners
Topic: Pen Position
Replies: 9
Views: 1126

Just like in QB, you use the POINT() function.

POINT(0) returns the current X coordinate. POINT(1) returns the current y coordinate.
by jofers
Aug 18, 2008 20:39
Forum: General
Topic: Run compiled code from a string?
Replies: 11
Views: 2312

Given the security concerns, I think it's a bad idea.

Have you looked into scripting libraries such as Lua, if you want user-programmable behavior?
by jofers
Aug 15, 2008 19:31
Forum: Beginners
Topic: Draw command for angles - not documented?
Replies: 4
Views: 1343

Here's the QB behavior:
http://www.qbasicnews.com/qboho/qckadvr@l80ad.shtml

No FB here though so I can't check.
by jofers
Aug 15, 2008 2:09
Forum: General
Topic: Atan2 Counter Intuitive?
Replies: 13
Views: 2469

It might help if the documentation used "dy, dx" instead, so people don't think of it as a cartesian coordinate.

Oh, and to score one for the y, x people, that's how it's done in wikipedia:
http://en.wikipedia.org/wiki/Atan2
by jofers
Aug 14, 2008 22:24
Forum: General
Topic: FreeBASIC generics?
Replies: 16
Views: 2977

It would have to be difficult. I just don't see how you could, since you would need to generate the function when it's instanced. But more generally, I don't like the idea of language features that are unportable. I spent a good deal of time trying to translate a number of macro-ridden Linux library...
by jofers
Aug 14, 2008 19:41
Forum: General
Topic: FreeBASIC generics?
Replies: 16
Views: 2977

Thanks marcov, I had always assumed the difference was arbitrary. I haven't worked much with other generics-supporting languages than C++, but I hate the idea of implementing C++ style templates, as that leads to code in the header files. Passing a description of a type's interface through the stack...
by jofers
Aug 12, 2008 21:34
Forum: Beginners
Topic: why is it always c or cpp
Replies: 26
Views: 4942

C is a mature, widely used, consistent, stable, officially standardized language which probably has the world's largest codebase. Furthermore, it is likely the only high-level language with support for every microprocessor in use. Now, compare that to a language with 50 different forking dialects va...
by jofers
Aug 12, 2008 21:26
Forum: General
Topic: FreeBASIC generics?
Replies: 16
Views: 2977

In C++ these are called templates, and in other languages it's called generics, but to the best of my knowledge it's not implemented yet.
by jofers
Aug 12, 2008 14:38
Forum: General
Topic: Pointer to your DATA:
Replies: 6
Views: 1128

They aren't that hard. The pointer to a data descriptor is stored in an extern in the run-time library, and the data descriptor has pointers to the data.

But don't use it. Use DATA, READ and RESTORE, or avoid that system at all. Hacking only leads to trouble when the internal format changes.
by jofers
Aug 10, 2008 8:00
Forum: General
Topic: Pointer to your DATA:
Replies: 6
Views: 1128

Stylin's way is the way to go. DATA adds overhead to keep track of the data, because it could be read out many ways, and it's not properly type-defined. Using initialized arrays makes sure that the memory you use is nothing but pure, unadulterated data. While BASIC respects newlines and line space, ...
by jofers
Aug 08, 2008 20:24
Forum: Beginners
Topic: Copying/Moving a block of array indexes
Replies: 8
Views: 1355

No, but you can have pointers. A pointer is a reference to another variable. Basically, if the entire memory was one big array, you would use a pointer as the index of that array. So, here's a quick example: Dim variable_a As Integer Dim variable_b As Integer Dim my_pointer As Integer Ptr ' Set vari...
by jofers
Aug 08, 2008 17:00
Forum: Beginners
Topic: Copying/Moving a block of array indexes
Replies: 8
Views: 1355

Sure you can create arrays on the fly. That's what heap memory is for. Dim array_reference As Integer Ptr ' Create the array array_reference = New Integer[10] array_reference[6] = 5 ' Delete the array Delete array_reference Dynamic arrays basically do the same thing with ReDim(), but pointers are a ...
by jofers
Aug 08, 2008 13:55
Forum: Beginners
Topic: Copying/Moving a block of array indexes
Replies: 8
Views: 1355

If you want a faster search time, you use a hash table. The hit either way is significant, but necessary if you want this functionality. You don't want to move an entire array every time you delete an entry, that would kill a program with large arrays and be insignificant for a program without large...
by jofers
Aug 07, 2008 17:35
Forum: General
Topic: Is “Dim As” redundant ?
Replies: 72
Views: 10996

I see where you're coming from, and let me explain. I'm not saying FB is based on VB in any way, shape or form, nor should it be. However, almost every modern feature of BASIC is excluded from the most recent official standard from 20 years ago. Even COBOL is much better maintained. The only standar...

Go to advanced search