Search found 474 matches

by BasicScience
Jan 11, 2014 22:04
Forum: General
Topic: Array or Ptr for UDT?
Replies: 3
Views: 368

Array or Ptr for UDT?

When using the data structure of a UDT for multiple copies, is there a reason to choose pointer arithmetic over an array allocation? Since the UDT would typically be allocated as SHARED in a .BI file, the whole array would not need to be passed to s SUB or FUNCITON so it doesn't seem as though there...
by BasicScience
Dec 14, 2013 2:40
Forum: Community Discussion
Topic: How many people actually use FreeBasic?
Replies: 85
Views: 13096

Re: How many people actually use FreeBasic?

I use FB daily in a university lab. Our data acquisition, data analysis, and simulation are all done in FB. I really like the mix of simplicity, yet power. Having started with QB45 back in the early 90's, FB has really come a long way. I've also written many teaching simulations in FB. My only regre...
by BasicScience
Nov 18, 2013 18:21
Forum: General
Topic: Namespace (again) This time for procedures
Replies: 5
Views: 577

Re: (resolved) Namespace (again) This time for procedures

I didn't realize a namespace could be split into multiple blocks. Got it now. Thanks
by BasicScience
Nov 18, 2013 17:09
Forum: General
Topic: Namespace (again) This time for procedures
Replies: 5
Views: 577

Re: Namespace (again) This time for procedures

How about this... It works, but is it using good practice? Namespace Junk Type Procs dim as single x declare sub test1(byval z as single) End Type END Namespace dim as junk.procs MyProcs MyProcs.x = 5 print MyProcs.x MyProcs.Test1(10) sleep Sub Junk.Procs.Test1(byval z as single) print z end sub
by BasicScience
Nov 18, 2013 17:06
Forum: General
Topic: Namespace (again) This time for procedures
Replies: 5
Views: 577

Re: Namespace (again) This time for procedures

OK, I see your code works. But, how should this be done if the goal is to create a BI file that uses Namespace to keep variable and procedure names specific, but the procedures are in a compiled library or are in other code modules? In these cases, the code for the procedure(s) cannot be included in...
by BasicScience
Nov 18, 2013 15:44
Forum: General
Topic: Namespace (again) This time for procedures
Replies: 5
Views: 577

Namespace (again) This time for procedures

Why does this code work for variable x, but fail for the subroutine? Compiler gives error message: undefined reference to `JUNK::PROCS::TEST1(float)@8 Namespace Junk Type Procs dim as single x declare sub test1(byval z as single) End Type END Namespace dim as junk.procs MyProcs MyProcs.x = 5 print M...
by BasicScience
Nov 17, 2013 18:31
Forum: General
Topic: Assignment in Namespace
Replies: 8
Views: 649

Re: Assignment in Namespace

Yes, I agree with you. junk.MyArray is global (static and shared) in this example The point I was trying to verify is that the variable name MyArray is local to the JUNK namespace. MyArray is not declared outside JUNK and therefore is not encroaching on a possible conflict with another variable in M...
by BasicScience
Nov 17, 2013 18:20
Forum: General
Topic: Assignment in Namespace
Replies: 8
Views: 649

Re: Assignment in Namespace

@FXM, I don't understand. Here's an example that shows MyArray is NOT global (which is what I want). Namespace junk Const maxpt = 100 const maxarray = 10 Type _Array x(maxpt) as single y(maxpt) as single end type Dim MyArray as _Array ptr END Namespace Junk.MyArray = CALLocate (junk.MaxArray*len(Jun...
by BasicScience
Nov 17, 2013 17:59
Forum: General
Topic: Assignment in Namespace
Replies: 8
Views: 649

Re: Assignment in Namespace

looks like this works. Is it Kosher? Namespace junk Const maxpt = 100 const maxarray = 10 Type _Array x(maxpt) as single y(maxpt) as single end type Dim MyArray as _Array ptr END Namespace Junk.MyArray = CALLocate (junk.MaxArray*len(Junk._Array)) With Junk.MyArray[0] .x(0) = 1 .y(0) = 10 print .x(0)...
by BasicScience
Nov 17, 2013 17:45
Forum: General
Topic: Assignment in Namespace
Replies: 8
Views: 649

Re: Assignment in Namespace

Thanks to you both (@fxm and @dkl)

So following the (corrected) example by fxm, what's the best method to have MyArray be a part of the JUNK namespace but not Global?
by BasicScience
Nov 17, 2013 16:33
Forum: General
Topic: Assignment in Namespace
Replies: 8
Views: 649

Assignment in Namespace

Why does this generate an error: "error 111: Illegal inside a NAMESPACE block, found '=' in 'MyArray = CALLocate (MaxArray*len(MyArray))" Namespace junk Const maxpt = 100 const maxarray = 10 Type _Array x(maxpt) as single y(maxpt) as single end type Dim Shared MyArray as _Array Ptr MyArray...
by BasicScience
Mar 08, 2013 3:14
Forum: Projects
Topic: FB_GUI V1.20.4 (New Release Oct 29, 2011)
Replies: 102
Views: 37011

Re: FB_GUI V1.20.4 (New Release Oct 29, 2011)

Hi OldJohn, Thanks for the interest in FB_GUI. I just re-compiled FB_GUI 1.20.4 with FBide and all is working well. Rather than attempt to track down your problem, I will post an upgrade in a day or two. We still use FB_GUI every day in our lab, and many small tweaks and bug fixes have been made sin...
by BasicScience
Dec 26, 2012 19:15
Forum: General
Topic: ScreenEvent - clear pending events
Replies: 2
Views: 362

Re: ScreenEvent - clear pending events

Thanks, I'll give it a try.

Alternatively, it would be even better if there were a method to transiently disable/enable screenevent. This way, the program could halt accumulation of events into the buffer, then resume later.
by BasicScience
Dec 25, 2012 22:07
Forum: General
Topic: ScreenEvent - clear pending events
Replies: 2
Views: 362

ScreenEvent - clear pending events

Is there a method to manually clear all then events in the ScreenEvent queue? This information must be be in the Event buffer. Why would one want to do this? Main loop of program uses screenevent to detect system events and act on them. But, some routines make calls direct calls to GetMouse (without...
by BasicScience
Dec 16, 2012 5:04
Forum: Projects
Topic: XFont Text Render Library [v11.9.13]
Replies: 63
Views: 22662

Re: XFont Text Render Library [v11.9.13]

@ Lionhart, I came across a bug in xFont. The LoadFont function will close file number 1, which can be a problem if the main program has another file assigned to number 1. The LoadFont function does use FF = FreeFile, and reads from #FF... but then accidentally closes #1 Section of code posted below...

Go to advanced search