Search found 12022 matches

by fxm
Mar 13, 2013 20:27
Forum: General
Topic: Duplicated definition in operator =
Replies: 15
Views: 2880

Re: Duplicated definition in operator =

counting_pine wrote:operators can be declared on built-in types
Only for conditional operators.
by fxm
Mar 13, 2013 13:48
Forum: General
Topic: Is this a bug that is already known?
Replies: 4
Views: 520

Re: Is this a bug that is already known?

Extract of documentation about KeyPgOpNot : Operator Not (Complement) Returns the bitwise-not (complement) of a numeric value Syntax: declare operator Not ( byref rhs as byte ) as integer declare operator Not ( byref rhs as ubyte ) as integer declare operator Not ( byref rhs as single ) as integer ...
by fxm
Mar 13, 2013 9:10
Forum: Beginners
Topic: How to use the mask color with a bmp image on freebasic?
Replies: 14
Views: 4154

Re: How to use the mask color with a bmp image on freebasic?

Try to declare 'pixels' as a 'short ptr':

Code: Select all

  dim as integer wid,hgt,bypp,pitch,pitchBy2
  dim as short ptr pixels
by fxm
Mar 12, 2013 19:10
Forum: General
Topic: Squares
Replies: 8041
Views: 779587

Re: Squares

A small variant: Function multiply (Byval a As Integer, Byval b As Integer) As Integer Dim As Integer c For I As Integer = 0 to 31 If Bit(b, I) then c += a End If a Shl= 1 Next I Function = c End Function Dim As Integer a = 1234, b = 5678 Print a * b Print multiply(a, b) Sleep
by fxm
Mar 12, 2013 17:37
Forum: General
Topic: Squares
Replies: 8041
Views: 779587

Re: Squares

... is there a correct formula to mul (a x b) by just shifting ??? and summing. Function multiply (Byval a As Integer, Byval b As Integer) As Integer Dim As Integer c For I As Integer = 0 to 31 If Bit(b, I) then c += a Shl I End If Next I Function = c End Function Dim As Integer a = 1234, b = 5678 ...
by fxm
Mar 11, 2013 17:24
Forum: Community Discussion
Topic: The new website
Replies: 150
Views: 32808

Re: The new website

fxm wrote:Always these two FBWiki pages polluted by warning messages as showed above!
Can you do something about it?
Thank you very much for removing these warnings.
This is much nicer now!
by fxm
Mar 09, 2013 22:58
Forum: Community Discussion
Topic: New to git: Functions with byref returns
Replies: 140
Views: 30567

Re: New to git: Functions with byref returns

'Byref returns' can also be used by operators to return references (added a sentence in documentation: BYREF (function results) ) The following example is the implementing of a simple smart pointer: - A smart pointer is an object which behaves like a pointer but does more than a pointer. - This obj...
by fxm
Mar 09, 2013 14:51
Forum: General
Topic: Dimensioning problem
Replies: 8
Views: 779

Re: Dimensioning problem

You cannot declare a variable with a name that would be the value from another string variable.
Any symbol-name must be directly provided to compiler by means of alphanumeric characters text.
Even the contents of a constant string cannot used to declare a new variable name.
by fxm
Mar 09, 2013 12:17
Forum: General
Topic: Dimensioning problem
Replies: 8
Views: 779

Re: Dimensioning problem

'cntr31' must be defined and assigned to a value before your 'dim' declaration.

Example:

Code: Select all

dim as integer cntr31
'.....
cntr31 = 10
'.....
dim as string strings(cntr31)
by fxm
Mar 09, 2013 10:01
Forum: Community Discussion
Topic: The new website
Replies: 150
Views: 32808

Re: The new website

Always these two FBWiki pages polluted by warning messages as showed above!
Can you do something about it?
by fxm
Mar 07, 2013 9:06
Forum: Beginners
Topic: [Solved] Error Cannot find -lxfont
Replies: 5
Views: 1505

Re: Error Cannot find -lxfont

I suppose this refers to: XFont Text Render Library [v11.9.13]

Dowload the library for win (for example), and copy:
- 'xfont.bi' into ...\freebasic\inc
- 'libxfont.a' into ...\freebasic\lib\win32
by fxm
Mar 05, 2013 17:45
Forum: General
Topic: Return an array of strings from a function
Replies: 6
Views: 1760

Re: Return an array of strings from a function

Have you tested your program !!!

pos += 1
n += 1

oFile.ListFiles("\pages", "txt", page_list())
Why 'oFile.' ?
by fxm
Mar 05, 2013 11:58
Forum: General
Topic: Return an array of strings from a function
Replies: 6
Views: 1760

Re: Return an array of strings from a function

I want to know if my code it's fine, I need to retrieve a list of files of a folder and return it to a var-len array. Have you tried to correct at least the errors detected at compile time? Just a quick glance at your program! Sub ListFiles(byref path As String, byref extension As String, file() As...
by fxm
Mar 04, 2013 13:00
Forum: Documentation
Topic: Operator Let (assignment) / Copy Constructor
Replies: 21
Views: 6707

Re: Operator Let (assignment) / Copy Constructor

Any (already experienced) programmer knows that the copy constructor is always called by the compiler when a variable is passed to a procedure by value, or a result is returned from a procedure by value: - But in the latter case of returning by value, the copy constructor is called only if the 'Ret...