Search found 491 matches

by pestery
Jun 21, 2012 11:28
Forum: General
Topic: Strange behavior+crash, via GDB works !
Replies: 25
Views: 937

Re: Strange behavior+crash, via GDB works !

Could you provide some more information? Windows or Linux? What does your program do when running? How does the program crash, crash to desktop, frozen, is there an error message? Any information you think might be helpful :-) From personal experience, a crash (to desktop) is always due to a memory ...
by pestery
Jun 20, 2012 7:42
Forum: Beginners
Topic: Program structure issue - "included" programs
Replies: 4
Views: 355

Re: Program structure issue - "included" programs

You could also add something like this to your rootfinder file: #Ifndef __rootfinder_bas__ #Define __rootfinder_bas__ ' Add rootfinder code here #EndIf Using this in combination with #Include Once works very well. It means that if you forget or ignore one guard then the other will stop the file bein...
by pestery
Jun 19, 2012 11:18
Forum: Beginners
Topic: ReDim problems
Replies: 9
Views: 663

Re: ReDim problems

My mistake, it should have read: When using Extern you can't defined (using Dim or ReDim) the same value or array in difference modules. Thanks pointing that out fxm :-)
by pestery
Jun 19, 2012 8:46
Forum: Beginners
Topic: ReDim problems
Replies: 9
Views: 663

Re: ReDim problems

If you remove the ReDim Test(40) and change Dim As Integer Test(), TestUbound to Dim As Integer TestUbound then it works. It's a bit of a nuisance, but as fxm said, you can't defined (using Dim or ReDim) the same value or array in difference modules. The problem is similar to if you created a versio...
by pestery
Jun 18, 2012 11:53
Forum: General
Topic: Found bug in GCC emitter
Replies: 24
Views: 2629

Re: Found bug in GCC emitter

Just found another possible bug regarding Extern , or maybe I did something wrong because I haven't really used Extern much until now. The basic problem is that when using Extern with an array the GCC backend doesn't seem to declare the array. It work with GAS so I'm guessing this is a problem with ...
by pestery
Jun 15, 2012 8:04
Forum: Community Discussion
Topic: The Freebasic Magic castle , interactive dungeon
Replies: 24
Views: 2633

Re: The Freebasic Magic castle , interactive dungeon

Just playing around with the sample code from the Freebasic tutorial files regarding internet chatting... Easy enough. TESLACOIL and I got a simple chat program working a while ago. Here's a link to the code if your interested. It could definitely be improved and it doesn't do data compression or e...
by pestery
Jun 13, 2012 10:01
Forum: General
Topic: Project layout
Replies: 34
Views: 2734

Re: Project layout

IOW can you compile the program in parts, or only in one go? Yes. Use the compiler option -c http://www.freebasic.net/wiki/wikka.php?wakka=CompilerOptc I was experimenting with this yesterday using FbEdit. It seems to work well enough, although FbEdit crashed when I included crt.bi in one of my mod...
by pestery
Jun 12, 2012 7:19
Forum: Beginners
Topic: A question about pointers
Replies: 5
Views: 416

Re: A question about pointers

A bit off topic, but you could also use subTest(ByRef p As tVector) which is essentially the same as subTest(ByVal p As tVector Ptr), except the compiler handles the pointer stuff for you. So then the p.x=0 would work. Although it's still very useful to know the in's and out's of pointers :-)
by pestery
Jun 10, 2012 2:28
Forum: Tips and Tricks
Topic: New cycle-count macros (Windows only)
Replies: 7
Views: 1763

Re: New cycle-count macros (Windows only)

I've been using the old version for a long time and it helped a lot when trying to speed up code (before I started using -gen gcc -O max), although the new version seems to runs about twice as fast as the old version on my computer. The results are still consistent so, I guess it doesn't matter. By ...
by pestery
Jun 08, 2012 14:34
Forum: Beginners
Topic: New member - how to use
Replies: 24
Views: 1472

Re: New member - how to use

The .bas (and .bi) files that FreeBASIC uses are simply plain unformatted text files with a .bas (or .bi) extension instead of a .txt extension. You could just as easily edit them using notepad :-)

As for your old .bas file/s, no idea. What fxm said I guess.
by pestery
Jun 08, 2012 8:36
Forum: Beginners
Topic: Copy an array
Replies: 19
Views: 1126

Re: Copy an array

My mistake, I should have put SizeOf(b(LBound(b))) instead of SizeOf(b) :-)
by pestery
Jun 08, 2012 7:43
Forum: General
Topic: Multikey problem - bug ? (FIXED)
Replies: 5
Views: 363

Re: Multikey problem - bug ? Solved temporarily ?

As fxm said, MultiKey checks if the key is pressed at the time when Multikey is called. This is good for things like scrolling, moving, steering, and so on, where you will be holding down the key for some amount of time. For quick key presses, such as jumping, typing text, and so forth, you are bett...
by pestery
Jun 08, 2012 7:23
Forum: Beginners
Topic: special key recognition
Replies: 5
Views: 345

Re: special key recognition

@CodeFoil I have a similar program on my computer :-) @rogerbohl Depending on your requirements, you might be able to use MultiKey or ScreenEvent , both of which support an extended key set. Although nothing within FB supports the Pause, Print Screen, or Scroll Lock keys (at least as far as I know)....
by pestery
Jun 08, 2012 7:12
Forum: Beginners
Topic: Copy an array
Replies: 19
Views: 1126

Re: Copy an array

You could use memcpy(). Just make sure you don't overrun the end of the array. #Include "crt/string.bi" memcpy(@b(LBound(b)), @a(LBound(a)), SizeOf(b) * (UBound(b) - LBound(b) + 1)) #Include "crt/string.bi" #Define arraycopy(dest, src) memcpy(@dest(LBound(dest)), @src(LBound(dest...
by pestery
Jun 08, 2012 7:01
Forum: Beginners
Topic: New member - how to use
Replies: 24
Views: 1472

Re: New member - how to use

The three common IDEs used with FreeBASIC are Geany, FBIDE and FbEdit. As the first two have been mentioned already, here's where to get the third, FbEdit, http://radasm.cherrytree.at/fbedit/ . I'd suggest your try all three and see which one you like the best. FbEdit is my personal preference, but ...

Go to advanced search