my best effort
Re: my best effort
If you could post actual pieces of the affected code, it would be easier to help you.
-
- Posts: 65
- Joined: Jul 01, 2021 7:53
Re: my best effort
I can't find any information about FBCAD on Google. Could you give me a link to your project?
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: my best effort
What I do:
declare a common shared pointer of the UDT type
use one sub or a set of subs to maintain the UDT array
the main sub for maintenance is a container; the UDT array is declareded as STATIC
- the array is redimmed as needed for the ubound; after any/each redim PRESERVE - reassign the UDT pointer to the (0) or (0,0,0,...) array item
- only grow the array in one (first?) dimension;
create a macro that properly calculates the index into the array - share that with any module needing access
use the pointer to get that UDT array item anywhere
works well in several locations of my libraries
david
declare a common shared pointer of the UDT type
use one sub or a set of subs to maintain the UDT array
the main sub for maintenance is a container; the UDT array is declareded as STATIC
- the array is redimmed as needed for the ubound; after any/each redim PRESERVE - reassign the UDT pointer to the (0) or (0,0,0,...) array item
- only grow the array in one (first?) dimension;
create a macro that properly calculates the index into the array - share that with any module needing access
use the pointer to get that UDT array item anywhere
works well in several locations of my libraries
david
Re: my best effort
Now that the array descriptor is easily accessible to the user (for fbc version >= 1.08), it might be better to work with a descriptor pointer (value always constant when the array is resized) rather than with a pointer to array elements (variable value when array is resized).
In addition, all the array information is included in the descriptor data.
Example:
In addition, all the array information is included in the descriptor data.
Example:
Code: Select all
#include "fbc-int/array.bi"
Redim As Integer array(0)
Dim As Any Ptr p0 = @array(0)
Dim As FBC.FBARRAY Ptr pdescript = FBC.ArrayDescriptorPtr(array())
Print p0, pdescript->base_ptr
Redim array(10000)
p0 = @array(0)
Print p0, pdescript->base_ptr
Sleep
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: my best effort
fxm: yes
Just beginning to work with 1.08.x - but that should be the way to go.
But can you have redimmable UDT arrays with that descriptor?
My way, you can, with 1/4 of the code in the example.
To be explored, then discussed on another topic thread.
david
Just beginning to work with 1.08.x - but that should be the way to go.
But can you have redimmable UDT arrays with that descriptor?
My way, you can, with 1/4 of the code in the example.
To be explored, then discussed on another topic thread.
david
Re: my best effort
Yes, you can resize an array from the address of its descriptor only.speedfixer wrote: But can you have redimmable UDT arrays with that descriptor?
See my code addition:
Code: Select all
#include "fbc-int/array.bi"
Redim As Integer array(0)
Dim As Any Ptr p0 = @array(0)
Dim As FBC.FBARRAY Ptr pdescript = FBC.ArrayDescriptorPtr(array())
Print p0, pdescript->base_ptr
Redim array(10000)
p0 = @array(0)
Print p0, pdescript->base_ptr
Print
'------- code addition
Type mydescriptor '' not allowed at local level
Dim As Integer a(Any) '' because it has a default
End Type '' constructor / destructor
Sub resize(Byval p As Any Ptr, Byval ub As Integer)
Dim As mydescriptor Ptr pmd = p
Redim pmd->a(ub)
End Sub
Print Ubound(array)
resize(pdescript, 50000)
Print Ubound(array)
Sleep
- 'pmd->a()' is a kind of reference to 'array()' (through only a pointer to its descriptor).
Re: my best effort
It is with great sadness that I inform our members that Owen Paul Reese, author of FBCADCAM and the OP of this thread, passed away on 01/14/2022 at 1:35 AM due to heart issues. I had the privilege to know and work for him for a while, and he was a great person with a kind soul. My condolences go to his daughter and wife. I will surely miss you, old man
Re: my best effort
sad to hear
Re: my best effort
Seeing the sad news led me to read part of this thread and learn who Owen was, as I'd never interacted with him. I'm impressed and inspired by what he did there in the Philippines. The world needs more people like him, especially now that it's lost one. Peace.
Re: my best effort
His WEB "FBCAD" ( https://fbcadcam.com/index.html ) is "off", no download, no forum ....
It's sad to think about it, but the years go by.
I registered 12 years ago when I was 43, I am now 55 and as much as it hurts to think about it, it could happen to me any day now. We get "old".
It's sad to think about it, but the years go by.
I registered 12 years ago when I was 43, I am now 55 and as much as it hurts to think about it, it could happen to me any day now. We get "old".
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: my best effort
R.I.P "owen"
source code: https://fbcadcam.org/beta/fbcadcam-2019 ... e-only.zip
you have to execute "fbcadcam-2019-02-24.exe" from the "gtk+-bundle_3.8.2-20130704_win32-RC1\bin" folder
Joshy
fbcadcam with GTK: https://fbcadcam.org/beta/fbcadcam-2019-02-24.zipjepalza wrote:... no download ...
source code: https://fbcadcam.org/beta/fbcadcam-2019 ... e-only.zip
you have to execute "fbcadcam-2019-02-24.exe" from the "gtk+-bundle_3.8.2-20130704_win32-RC1\bin" folder
Joshy
Re: my best effort
Curiously, links Don't work --> https://fbcadcam.org/beta/ but direct access yes!!!
Lastest download forever
Lastest download forever
Re: my best effort
These links don't seem to be working for me, just wondering if it's something on my side?D.J.Peters wrote: ↑May 06, 2022 9:11 R.I.P "owen"fbcadcam with GTK: https://fbcadcam.org/beta/fbcadcam-2019-02-24.zipjepalza wrote:... no download ...
source code: https://fbcadcam.org/beta/fbcadcam-2019 ... e-only.zip
you have to execute "fbcadcam-2019-02-24.exe" from the "gtk+-bundle_3.8.2-20130704_win32-RC1\bin" folder
Joshy
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact: