Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / arrays in user defined type

Author
Message
trimbandit
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 20th Aug 2003 06:18
Hi,
I was wondering how to include arrays in a user defined data type. I get an error compiling. Sorry if this is a stupid question.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Aug 2003 00:11
post your code

-RUST-
trimbandit
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 22nd Aug 2003 06:39
TYPE mytype
var1
var2
dim whatever(6,2) as integer
ENDTYPE

Error is "Cannot declare an array within type"
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 22nd Aug 2003 17:54
Your problem lies in how you are turning the array into a UDT (User Defined Type). Observe...
Type mytype
var1 AS INTEGER
var2 AS INTEGER
endtype
dim whatever(6,2) AS mytype

The type, endtype, and everything in between the two commands define the UDT. After the type is defined, you then prolcaim any variable or array you want to use this UDT with an AS and the name of the UDT. A least, that's how I see it, you'd proboly want to ask someone with more than two months of experiance for a REAL good explanation.
trimbandit
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 22nd Aug 2003 20:07
I don't want an array of my UDT; I want an array of integers as one component of my UDT as shown in my code.

TYPE mytype
var1 as integer
var2 as integer
dim var3(6,2) as integer
ENDTYPE
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Aug 2003 20:30
That's something that DBPro can't do yet.
trimbandit
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 22nd Aug 2003 21:03
OK, cool thanks. I was just suprised because you can do that sort of thing in c or vb.
Whopper
21
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 17th Sep 2003 08:21
Quote: "That's something that DBPro can't do yet. "


Wow, thats quite a hindrance to writing well structured code. Is there a workaround?

If not, when will this feature be available?

Login to post a reply

Server time is: 2024-11-25 08:44:41
Your offset time is: 2024-11-25 08:44:41