Search found 496 matches

by aloberoger
Apr 21, 2023 15:24
Forum: Windows
Topic: TChar Header from crt
Replies: 2
Views: 1998

Re: TChar Header from crt

Can be usefull to build applications that supports Unicode or not
I use this header to implement CString, which makes it even easier to program in UNICODE
I thing CString is better than Freebasic String in this way.
by aloberoger
Apr 21, 2023 15:20
Forum: Windows
Topic: TChar Header from crt
Replies: 2
Views: 1998

TChar Header from crt

Tchar.bi /' * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. '/ '#include Once "crt\crtdefs.bi" #ifndef _INC_TCHAR #define _INC_TCHAR...
by aloberoger
Oct 22, 2022 9:49
Forum: General
Topic: error 51: User Defined Type too big
Replies: 34
Views: 3589

Re: error 51: User Defined Type too big

I thinks we can do better type CForm1 Extends CForm private: As CBUTTON Command1(100) ' this is allowed or As CBUTTON ptr Command1(any) Declare Static Sub Command1_MouseDown(ByRef sender As object,Button As Integer, Shift As Integer, X As Integer, Y As Integer) public: Declare Constructor() End typ...
by aloberoger
Dec 02, 2021 17:07
Forum: Windows
Topic: INSIDE ACTIVEX WITH FREEBASIC
Replies: 118
Views: 42814

Re: INSIDE ACTIVEX WITH FREEBASIC

you don't have modified .bi so use lptvbl->
by aloberoger
Oct 28, 2021 20:12
Forum: Community Discussion
Topic: FreeBASIC 1.09.0 Release
Replies: 256
Views: 52477

Re: FreeBASIC 1.08.1 and 1.09.0 Development

UEZ wrote
Thank you Joshy. Just before you posted it I figured out, too that the priority is different than in other programming languages.
has the problem been repaired?
by aloberoger
May 05, 2021 6:10
Forum: General
Topic: HalfBug (incosistency??) with returning UDTs
Replies: 3
Views: 793

Re: HalfBug (incosistency??) with returning UDTs

what about returning byref AS UDT ?
by aloberoger
May 03, 2021 18:15
Forum: Sources, Examples, Tips and Tricks
Topic: remove duplicates intries in an array
Replies: 25
Views: 4510

Re: remove duplicates intries in an array

ok it's good now, i will test the speed later
by aloberoger
May 02, 2021 18:09
Forum: Sources, Examples, Tips and Tricks
Topic: remove duplicates intries in an array
Replies: 25
Views: 4510

Re: remove duplicates intries in an array

fxm I think you need to improve your code a bit because look what happens with this example. Sub RemoveDuplicate OverLoad (Arr() As String,Lanswer()As String) Redim Lanswer(0) Scope Dim As Long flag For n1 As Long=Lbound(Arr) To Ubound(Arr) flag=0 For n2 As Long=n1+1 To Ubound(Arr) If Arr(n1)=Arr(n2...
by aloberoger
Apr 30, 2021 1:00
Forum: General
Topic: Finer control of access within a Type ... Extends
Replies: 20
Views: 2333

Re: Finer control of access within a Type ... Extends

fxm wrote - Pointer arithmetic depends of the variable type pointed to. When adding for example '+1' to a typed pointer, the resulting pointer value (address) is incremented by the size of the variable type pointed to. Pointer arithmetic is also allowed on an 'Any Ptr', but it is treated (by conven...
by aloberoger
Mar 11, 2021 20:00
Forum: Sources, Examples, Tips and Tricks
Topic: remove duplicates intries in an array
Replies: 25
Views: 4510

Re: remove duplicates intries in an array

the method of fxm is correct, but not suitable for large loops on the other hand the dodicat method is optimized but does not give the expected result for the following case: Dim mem () As Long Redim mem (0 to 6) mem (0) = 10 mem (1) = 12 mem (2) = 12 mem (3) = 11 mem (4) = 10 mem (5) = 20 mem (6) =...
by aloberoger
Mar 11, 2021 19:04
Forum: Sources, Examples, Tips and Tricks
Topic: remove duplicates intries in an array
Replies: 25
Views: 4510

Re: remove duplicates intries in an array

in general for the automated drawing there are often duplicate values ​​that can draw a text for example twice, when one wants to perform operations on the text, only one text is selected. and ...
by aloberoger
Mar 08, 2021 18:26
Forum: Sources, Examples, Tips and Tricks
Topic: remove duplicates intries in an array
Replies: 25
Views: 4510

remove duplicates intries in an array

Sub RemoveDuplicate (Arr() As Integer) Dim i As Integer Dim k As Integer k = LBound(Arr) For i = LBound(Arr)+1 To UBound(Arr) If Arr(k) <> Arr(i) Then k = k + 1 Arr(k) = Arr(i) End If Next i ' Remove unused entries from the result array. ReDim Preserve Arr(LBound(Arr) To k) End Sub Dim mem() As Int...
by aloberoger
Aug 13, 2020 18:48
Forum: Sources, Examples, Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 3414

Re: Byref in return function

with these two functions things are normal. curious that you still have bugs Constructor CPicture(ByVal opic As IPicture Ptr) If m_pPicture Then m_pPicture->lpvtbl->Release(m_pPicture) EndIf m_pPicture=opic If m_pPicture Then m_pPicture->lpvtbl->AddRef(m_pPicture) EndIf End Constructor Operator CPic...
by aloberoger
Aug 13, 2020 18:43
Forum: Sources, Examples, Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 3414

Re: Byref in return function

José said ...
if you have an example on hand, this will be welcome please
by aloberoger
Aug 12, 2020 18:13
Forum: Sources, Examples, Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 3414

Re: Byref in return function

I said with this in constructor and operator

Code: Select all

If m_pPicture then m_pPicture-> lpvtbl-> AddRef (m_pPicture)
we can use delete see my last post
but it seems to me that because of the reference even if Delete is not used the memory is erased?
what do you thing?