Search found 8990 matches

by fxm
Jul 15, 2019 20:27
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4811

Re: New array features

But ... what does an added feature teach a newbie when it is added "in a twisted way"? Is the message to be: obfuscation and code tricks are a good practice? Or - go away, you aren't ready for this? Maybe I did not express myself well, but on the contrary I wanted to say that it is better...
by fxm
Jul 15, 2019 17:59
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4811

Re: New array features

I hope that all these new features for arrays will be compatible not only of all types predefined by fbc (including the var-len string), but also any type defined by the user (taking into account its own constructors/destructor and overload operators if exist).
by fxm
Jul 15, 2019 13:43
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4811

Re: New array features

What would freebasic's array2() = array1() aspire to be? Both static and dynamic arrays with similar dimensions up to 8 resulting in completely individual arrays ? For example, only allowed by the compiler for two arrays of the same type and number of dimensions (or the destination array of same ty...
by fxm
Jul 15, 2019 8:39
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4811

Re: New array features

Yes, but for example for the new array copy feature: ⋅ it would be nice to be able to write it in the natural form: array2() = array1() => evolution of the implicit 'Let operator', ⋅ and not: copyArray(array2, array1) => where 'copyArray' would be for exam...
by fxm
Jul 15, 2019 5:34
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4811

Re: New array features

I agree. The most important thing for a user is to add in FBC features that do not exist yet and that the user can not code himself, or do it, but in a twisted way. For me, this ability to discriminate between an array of fixed size and an array of variable size is interesting (like the ability to e...
by fxm
Jul 10, 2019 17:54
Forum: General
Topic: Squares
Replies: 6702
Views: 382132

Re: Squares

screen 19 dim as longint v1 , v2 , v3 , v4 do dim as longint n1 = int( rnd * 65536 ) v1 = n1 mod 256 v2 = n1 \ 256 print print n1 , v1 , v2 ' for b as longint = 0 to 65535 step 1 ' if b mod 256 = v1 and b \ 256 = v2 then print b : exit for ' next print v2 * 256 + v1 sleep loop until inkey = chr(27)...
by fxm
Jul 10, 2019 7:19
Forum: General
Topic: Squares
Replies: 6702
Views: 382132

Re: Squares

screen 19 do const as integer n = 2 '' 2: for displaying 2 decimal digits at most const as integer c = 10 ^ n dim as double d dim as string s dim as integer i d = int( rnd * 65536 ) / 256 '' decimal number to round to 'n' decimal digits at most s = str( clngint( d * c ) / c ) '' to round the 'n'th ...
by fxm
Jul 04, 2019 19:30
Forum: Documentation
Topic: Wiki improvements
Replies: 336
Views: 25752

Re: Wiki improvements

@coderJeff, about adding a new anchor (link to a location on the same page). I added this note in FBWikiFormatting documentation page: Note about adding a new anchor: - Don't pretest the new anchor link through the "Preview" mode, otherwise that cancels all changes in progress done with &q...
by fxm
Jul 04, 2019 7:01
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3715

Re: Extending Wstring and Zstring with UDTs

It's been helpful that fxm, very consistently, brings the perspective of a skilled and and knowledgeable user to the community. I think we have made a pretty good team over last couple years to solve some compiler issues. fxm providing the user point of view, and myself providing the developer poin...
by fxm
Jul 04, 2019 6:31
Forum: General
Topic: Why doesn't this crash (UDT copy)
Replies: 4
Views: 284

Re: Why doesn't this crash (UDT copy)

badidea wrote:Thanks, the compiler is more advanced than I expected :-)

We must thank dkl.
by fxm
Jul 04, 2019 5:52
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3715

Re: Extending Wstring and Zstring with UDTs

Obviously we could merge the 2 pages ( 'Pointer' and 'Ptr' ) into one ( 'Pointer | Ptr' ). (keeping 'KeyPgPtr' as the main link, as there will be fewer 'KeyPgPointer' links to rename) Done (1 page emptied and 24 pages updated). @coderJeff, Can you completely ...
by fxm
Jul 03, 2019 5:15
Forum: General
Topic: Why doesn't this crash (UDT copy)
Replies: 4
Views: 284

Re: Why doesn't this crash (UDT copy)

@MrSwiss, There is one 'This' missing ! :-) Erase(This.points) (but I do not criticize your remark: I, too, always precise 'This.' in the member procedures) @badidea, (more seriously) For UDT containing a dynamic array as a member field, the implicit Let operator: - Size the ...
by fxm
Jul 02, 2019 16:55
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3715

Re: Extending Wstring and Zstring with UDTs

1) As long as it is not dereferenced, a pointer can take any value, even a value corresponding to an invalid memory address. This is why I wrote this caution only at the level of each dereferencing operator. For example, if one defines an array as: Dim As Integer array(10 To 20) the first in...
by fxm
Jul 02, 2019 15:45
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3715

Re: Extending Wstring and Zstring with UDTs

Done:
- KeyPgOpValueOf → fxm [Added a caution about a null pointer use or a resulting address corresponding to invalid memory access]
- KeyPgOpPtrIndex → fxm [Added a caution about a null pointer use or a resulting address corresponding to invalid memory access]
by fxm
Jul 02, 2019 5:05
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3715

Re: Extending Wstring and Zstring with UDTs

If this automatic Zstring conversion was limited for a [U]Byte only (and therefore not for an Integer nor a Boolean), 'If *pz Then ...' would probably be refused at compilation step. (Wstring conversion limited to a [U]Long or a [U]Longint only, not for an Integer nor a Boolean) To try to c...

Go to advanced search