Array problem 
Author Message
 Array problem

I'll try posting again... looks like my last post didn't go through:

I need to have a TYPE with an "array" which is not fixed.
And if this can't be done, does anyone have a good work around?

#COMPILE EXE

TYPE Test
    Test1 AS INTEGER
    Test2 AS EXT
    Test3(1 TO 1) AS DOUBLE  '<---I don't want a fixed array
END TYPE

FUNCTION WINMAIN (BYVAL CurInst AS LONG, _
                  BYVAL PrvInst AS LONG, _
                  CmdLine AS ASCIIZ PTR, _
                  BYVAL CmdShow AS LONG) EXPORT AS LONG

    DIM TestType AS Test
    DIM CopyArray() AS DOUBLE
    DIM Records AS LONG
    LOCAL u1 AS LONG

    'Records = RecordCount()
    Records = 1203 'For example

    REDIM CopyArray(1 TO Records) AS DOUBLE
    'Data is inserted into CopyArray()

    TestType.Test1 = 1
    TestType.Test2 = 2.1

    u1 = UBOUND(CopyArray)
    REDIM TestType.Test3(1 TO u1) AS DOUBLE '<- no worky
    MAT TestType.Test3() = CopyArray()

END FUNCTION



Sun, 23 Nov 2003 09:39:32 GMT  
 Array problem
This cannot be done in powerbasic/Windows.  (AS I POINTED OUT IN MY REPLY IF
YOU HAD JUST BEEN PATIENT).

With PB Windows, the closest you can come is to store a pointer to the start
of the array data and use DIM AT to simulate an array.

But if you do feel like doing that, as long as you are not over 16K total
size of UDT, why not create the table thus:

 TYPE Test
     Test1 AS INTEGER
     Test2 AS EXT
     Test3Count   AS LONG
     Test3(1 TO 1000) AS DOUBLE
END TYPE

...and track Test3Count = current number of valid entries in the Test3 Table

--
Michael Mattias
Tal Systems
Racine WI USA


Quote:
> I'll try posting again... looks like my last post didn't go through:

> I need to have a TYPE with an "array" which is not fixed.
> And if this can't be done, does anyone have a good work around?

> #COMPILE EXE

> FUNCTION WINMAIN (BYVAL CurInst AS LONG, _
>                   BYVAL PrvInst AS LONG, _
>                   CmdLine AS ASCIIZ PTR, _
>                   BYVAL CmdShow AS LONG) EXPORT AS LONG

>     DIM TestType AS Test
>     DIM CopyArray() AS DOUBLE
>     DIM Records AS LONG
>     LOCAL u1 AS LONG

>     'Records = RecordCount()
>     Records = 1203 'For example

>     REDIM CopyArray(1 TO Records) AS DOUBLE
>     'Data is inserted into CopyArray()

>     TestType.Test1 = 1
>     TestType.Test2 = 2.1

>     u1 = UBOUND(CopyArray)
>     REDIM TestType.Test3(1 TO u1) AS DOUBLE '<- no worky
>     MAT TestType.Test3() = CopyArray()

> END FUNCTION



Sun, 23 Nov 2003 19:11:23 GMT  
 Array problem
For the record, in PowerBASIC's PB/CC and PB/DLL compilers, a single
UDT can be up to 64Mb, and arrays within a UDT can be up to 16Mb each.

The 16k limit mentioned in the PB/CC manual is incorrect.  

I hope this helps!

Quote:

>This cannot be done in PowerBASIC/Windows.  (AS I POINTED OUT IN MY REPLY IF
>YOU HAD JUST BEEN PATIENT).

>With PB Windows, the closest you can come is to store a pointer to the start
>of the array data and use DIM AT to simulate an array.

>But if you do feel like doing that, as long as you are not over 16K total
>size of UDT, why not create the table thus:

> TYPE Test
>     Test1 AS INTEGER
>     Test2 AS EXT
>     Test3Count   AS LONG
>     Test3(1 TO 1000) AS DOUBLE
>END TYPE

>...and track Test3Count = current number of valid entries in the Test3 Table

>--
>Michael Mattias
>Tal Systems
>Racine WI USA



>> I'll try posting again... looks like my last post didn't go through:

>> I need to have a TYPE with an "array" which is not fixed.
>> And if this can't be done, does anyone have a good work around?

>> #COMPILE EXE

>> FUNCTION WINMAIN (BYVAL CurInst AS LONG, _
>>                   BYVAL PrvInst AS LONG, _
>>                   CmdLine AS ASCIIZ PTR, _
>>                   BYVAL CmdShow AS LONG) EXPORT AS LONG

>>     DIM TestType AS Test
>>     DIM CopyArray() AS DOUBLE
>>     DIM Records AS LONG
>>     LOCAL u1 AS LONG

>>     'Records = RecordCount()
>>     Records = 1203 'For example

>>     REDIM CopyArray(1 TO Records) AS DOUBLE
>>     'Data is inserted into CopyArray()

>>     TestType.Test1 = 1
>>     TestType.Test2 = 2.1

>>     u1 = UBOUND(CopyArray)
>>     REDIM TestType.Test3(1 TO u1) AS DOUBLE '<- no worky
>>     MAT TestType.Test3() = CopyArray()

>> END FUNCTION

Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Sun, 23 Nov 2003 21:19:25 GMT  
 Array problem

Quote:
> For the record, in PowerBASIC's PB/CC and PB/DLL compilers, a single
> UDT can be up to 64Mb, and arrays within a UDT can be up to 16Mb each.

That's TABLES in a UDT. TABLES. These things are NOT &*^%^%#  ARRAYS!!!

Quote:
>The 16k limit mentioned in the PB/CC manual is incorrect.

Well, for positive spin, I guess we could say, "That documentation error
does not appear in the on-line help files."

Of course, that's because neither the PB/DLL (6.0) or PB/CC (2.0) help file
says shit about max UDT size (at least nothing I can find).

But what the hell, PB's only had two-plus years since the product was
released. I'm sure that updated documentation is right around the corner.

MCM



Tue, 25 Nov 2003 07:55:01 GMT  
 Array problem
VB has it's share of blemishes in the documentation and the
current version is over two years old and .net is still not released.
It will likely be a little late because Microsoft is backing
away from the radical changes that it was making to the
language(for the seventh time in VB history).

Did you have a point or are you just flaming?

Tim


Quote:


> > For the record, in PowerBASIC's PB/CC and PB/DLL compilers, a single
> > UDT can be up to 64Mb, and arrays within a UDT can be up to 16Mb each.

> That's TABLES in a UDT. TABLES. These things are NOT &*^%^%#  ARRAYS!!!

> >The 16k limit mentioned in the PB/CC manual is incorrect.

> Well, for positive spin, I guess we could say, "That documentation error
> does not appear in the on-line help files."

> Of course, that's because neither the PB/DLL (6.0) or PB/CC (2.0) help
file
> says shit about max UDT size (at least nothing I can find).

> But what the hell, PB's only had two-plus years since the product was
> released. I'm sure that updated documentation is right around the corner.

> MCM



Tue, 25 Nov 2003 09:56:02 GMT  
 Array problem
I guess I am just flaming. I just cannot understand how a compiler developer
can ask someone to pay an extra $29.00 for a manual, just so you can get
some additional documentation which is incorrect.

I do not like the fact that this limitation is not documented at all in the
standard product. Seems to me paying extra for documentation of known
limitations sucks sewer effluent.

I do not like it that I have submitted 'in the approved method' literally
SCORES of documentation errors to PB over the past ten years, perhaps half
of them when I was specifically asked to review that documentation prior to
its release (PB/DOS 3.5) and very few of these see the light of day.

I do not like that PB can't issue corrected documentation to registered
users at something approaching a useful interval.

Lastly, I am truly sick and tired of PowerBASIC using relative quality
control; that is, "if Microsoft documentation sucks, ours can, too." And now
you are doing it, too. Please stop.

MCM


Quote:
> VB has it's share of blemishes in the documentation and the
> current version is over two years old and .net is still not released.
> It will likely be a little late because Microsoft is backing
> away from the radical changes that it was making to the
> language(for the seventh time in VB history).

> Did you have a point or are you just flaming?

> Tim





> > > For the record, in PowerBASIC's PB/CC and PB/DLL compilers, a single
> > > UDT can be up to 64Mb, and arrays within a UDT can be up to 16Mb each.

> > That's TABLES in a UDT. TABLES. These things are NOT &*^%^%#  ARRAYS!!!

> > >The 16k limit mentioned in the PB/CC manual is incorrect.

> > Well, for positive spin, I guess we could say, "That documentation error
> > does not appear in the on-line help files."

> > Of course, that's because neither the PB/DLL (6.0) or PB/CC (2.0) help
> file
> > says shit about max UDT size (at least nothing I can find).

> > But what the hell, PB's only had two-plus years since the product was
> > released. I'm sure that updated documentation is right around the
corner.

> > MCM



Tue, 25 Nov 2003 22:54:10 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Difficult problem to solve: Tcl 7.3 to Tcl 8.0p2 Array of Array Problem

2. Array problem - adjust-array

3. 2d array problem

4. Multidimensions array problem

5. Control arrays problems : Killing elements !

6. Control arrays problems : Killing elements !

7. Array-Problem

8. Array problem

9. Array problem

10. Manifest Array Problem

11. read two sets of data from two spread sheet files to two arrays problem

12. Multi-dimensional array problem

 

 
Powered by phpBB® Forum Software