Search found 491 matches

by pestery
Jun 30, 2009 17:08
Forum: General
Topic: New verses Allocate
Replies: 9
Views: 1140

Thanks for the advice Vince, I'll have to look a little more closely at the way I tend to structure my programs and see if I can improve my method. As for my use of NEW I'll have to wait and see if anyone else has any other opinions.

-Matt
by pestery
Jun 30, 2009 16:30
Forum: General
Topic: New verses Allocate
Replies: 9
Views: 1140

Sorry, I should have pointed out that I'm shared pointers with Subs and Functions generally allocating the memory, not the main program. As I understand it REDIM cannot be used in a sub if the pointer is shared, let me know if this is wrong though. Dim Shared Ptr_A As Integer Ptr Sub Sub_A()...
by pestery
Jun 30, 2009 15:49
Forum: General
Topic: New verses Allocate
Replies: 9
Views: 1140

Thanks for the quick reply, it took me by surprise :P I've been using NEW in my program but I'm not defining any constructors or destructors (I'm self taught and haven't yet tried using constructors and destructors). Would NEW be overkill in my situation? Just a quick example of my use of NEW Type S...
by pestery
Jun 30, 2009 15:20
Forum: General
Topic: New verses Allocate
Replies: 9
Views: 1140

New verses Allocate

Hi all,
I was wondering what the difference is between use either New or Allocate to assign memory. For example, is there a difference in thread safety, or performance, etc. Is one generally preferred over the other. Thanks
by pestery
Dec 21, 2007 5:51
Forum: General
Topic: Problem using Condwait with a mutex
Replies: 17
Views: 3269

Its looks like my problem with CondWait was just a problem of time, that I found the example before the command had been added to the mainstream compiler (like P.J.Peters I also don't use the latest SVN version). I look forward to the next release of the compiler. notthecheatr If your not multi thre...
by pestery
Dec 19, 2007 6:55
Forum: General
Topic: Problem using Condwait with a mutex
Replies: 17
Views: 3269

Problem using Condwait with a mutex

I'm having a problem using the CondWait command with a mutex. MutexLock A_Mutex If TaskCount <= 0 Then CondWait A_Cond, A_Mutex MutexUnlock A_Mutex My compiler (v0.18.2b-win32) returns the error message: error 1: Argument count mismatch, found 'M__Mutex' in 'If TaskCount <= 0 Then CondWait A_Cond, A...
by pestery
Sep 26, 2007 10:59
Forum: Beginners
Topic: Problem with ScreenPtr in 16-bit color
Replies: 5
Views: 1694

Thanks Mysoft, your solution is much shorter and works just the same :)
by pestery
Sep 25, 2007 11:42
Forum: Beginners
Topic: Problem with ScreenPtr in 16-bit color
Replies: 5
Views: 1694

Problem with ScreenPtr in 16-bit color

Hi all, I just had a problem with my color being distorted when I used ScreenPtr to change the color of a pixel on the screen (I was using this method because it was much faster than using 'Line (x,y)-(x,y),color' Screenres 640,480,16 'Ushort because of 16-bit color (use Uinteger for 32-bit colo...
by pestery
Aug 03, 2007 12:05
Forum: Beginners
Topic: ScreenLock vs A Working Page
Replies: 8
Views: 2407

ScreenLock vs A Working Page

I was wondering, which would be the better option or is it just personal preference? Screenres 640,480,32,2 Dim As Integer workpage Do Screenset workpage,workpage Xor 1 workpage=workpage Xor 1 Cls 'draw something Loop While Inkey="" Screenres 640,480,32 Do Screenlock Cls 'draw something Sc...
by pestery
Jun 16, 2007 3:46
Forum: Beginners
Topic: Maths Question
Replies: 2
Views: 1148

The 65000's where variables in this case, but I can easily enough change them to being defined as double. I also found the Cdbl() command works to for if I didn't wont to change the variable type. Thanks cha0s.
by pestery
Jun 16, 2007 2:47
Forum: Beginners
Topic: Maths Question
Replies: 2
Views: 1148

Maths Question

G'day. I'm new to FreeBasic, making the conversion from qBasic as many seem to have done, and I'm having problems with multiplying large numbers together. My program is anyway :) This is the answer the program was giving me. 65000^2 = 4225000000 65000*65000 = -69967296 Anyone know why the second cal...

Go to advanced search