Search found 828 matches

by Munair
Mar 02, 2020 8:52
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

It is not just the Instr() function. You use mid() and you create new strings like str1+= chr( int( rnd * 256 ) and dict+= n1 . That isn't fast code by definition. A faster way would be to use predefined string buffers to avoid string allocation with each iteration. And if you want to make it really...
by Munair
Sep 07, 2019 10:49
Forum: Beginners
Topic: NULL equivalent in freeBASIC
Replies: 11
Views: 3363

Re: NULL equivalent in freeBASIC

In order to prevent any warnings, a solution might be two different definitions:

Code: Select all

#ifndef NULL
  #define NULL 0
#endif

#ifndef nil
   const nil as any ptr = 0
#endif
by Munair
Sep 01, 2019 6:16
Forum: Hardware Interfaces / Communication
Topic: Tip: The better Arduino "clones".
Replies: 3
Views: 7064

Re: Tip: The better Arduino "clones".

I use some Arduino Uno's to measure electricity in the atmosphere. This was a bit of a challenge because there was almost no information about setting up a circuit to do that. I use the TL081 and TL071 OpAmps whereby pin 3 acts as an antenna. Although these OpAmps are often considered the same, ther...
by Munair
Apr 30, 2019 5:37
Forum: Windows
Topic: GUI tool kit
Replies: 23
Views: 10919

Re: GUI tool kit

And do not plan cross-platform? well i leave that in your task...so start coding Cross-platform GUI is a tremendous task. Every OS has its unique interface and to support them all would require a kind of component library. Taking a look at Lazarus' LCL will give you some idea. It is HUGE, also beca...
by Munair
Apr 22, 2019 12:31
Forum: Beginners
Topic: Unexpected behaviour of type arrays
Replies: 8
Views: 2109

Re: Unexpected behaviour of type arrays

You'd get 10 if you'd assign the right types: TYPE athing x AS INTEGER END TYPE TYPE collection thing AS athing END TYPE DIM somethings(10) as athing DIM manythings(10) as collection somethings(0).x = 10 manythings(0).thing = somethings(0) PRINT manythings(0).thing.x Is there a technical reason for ...
by Munair
Apr 08, 2019 12:55
Forum: General
Topic: Endian
Replies: 14
Views: 1316

Re: Endian

marcov wrote:
albert wrote:Since the majority of computers on the planet , use AMD or Intel processors..


The vast majority is using network. So network order should be default :=)

Indeed.
by Munair
Apr 07, 2019 16:41
Forum: General
Topic: Endian
Replies: 14
Views: 1316

Re: Endian

dodicat wrote:Not that marcov
but
BINGO - I remember
Although it is so far back in the mists of time I was confused.
https://www.youtube.com/watch?v=tC1auBpqZ4E

Many great songs were penned by the Bee Gees.
by Munair
Apr 07, 2019 11:42
Forum: General
Topic: Endian
Replies: 14
Views: 1316

Re: Endian

https://en.wikipedia.org/wiki/Endianness#Current_architectures : The Intel x86 and also AMD64 / x86-64 series of processors use the little-endian format, and for this reason, it is also known in the industry as the "Intel convention". Yes, and very inefficiently, the network (internet) de...
by Munair
Mar 06, 2019 16:38
Forum: Projects
Topic: BASIC Studio for Linux (in development)
Replies: 127
Views: 12419

Re: BASIC Studio for Linux (in development)

As one may have noticed, there have been no updates here for a while. The reason is that I started development of a new interpreter/language for the project, which allows for fully integrated inspection, debugging and also language features such as class support and null objects (which I greatly mis...
by Munair
Feb 19, 2019 6:56
Forum: Beginners
Topic: How to convert String (or Double) to SerialNumber
Replies: 11
Views: 1173

Re: How to convert String (or Double) to SerialNumber

Yes, I forgot to include that QB's CInt in the first place converts numeric expressions to integer.
by Munair
Feb 18, 2019 18:40
Forum: Beginners
Topic: How to convert String (or Double) to SerialNumber
Replies: 11
Views: 1173

Re: How to convert String (or Double) to SerialNumber

Coming from QuickBASIC I find CInt() much more misleading for string to number conversion as in QB its only function was to round numeric expressions. In this respect Val() is more consistent in that it is traditionally associated with string to number conversion.
by Munair
Feb 18, 2019 6:17
Forum: Beginners
Topic: How to convert String (or Double) to SerialNumber
Replies: 11
Views: 1173

Re: How to convert String (or Double) to SerialNumber

counting_pine wrote:Otherwise, I'd recommend CInt(Mid(...)) instead of Val(Mid(...)), to avoid the floating-point math.

Why not use ValInt or in this case ValUInt directly?
by Munair
Feb 18, 2019 6:04
Forum: Community Discussion
Topic: Building FreeBASIC 1.06 Release
Replies: 46
Views: 6260

Re: Building FreeBASIC 1.06 Release

Thank you very much coderJeff for your commitment and efforts to keep the FB project going. I'm sure it's very much appreciated by many.
by Munair
Feb 08, 2019 18:55
Forum: General
Topic: Undefined Reference on just declarations
Replies: 12
Views: 973

Re: Undefined Reference on just declarations

In the past I used constructors a lot to do initial population of (object) arrays. In RealBASIC it was even mandatory or the object arrays' elements would not reference. Here is a basic example: type T x as integer end type type TList list(any) as T declare constructor(byval x as integer) end type c...
by Munair
Feb 08, 2019 10:37
Forum: Beginners
Topic: Matrix to string
Replies: 15
Views: 1275

Re: Matrix to string

Yes, marpon's suggestion will be a great speed improvement too, but it requires administering the string position and size.

Go to advanced search