May 14, 2024, 07:44:39 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Multi Array of UDT in project

Started by Pip1957, June 07, 2010, 05:37:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pip1957

Hi

I am trying to compile an old program of mine into a project but am having a problem with a multi dimension array of a UDT, I defined the UDT as TYPE BrowserData in an inc file
I then defined the array def browser[99,10]:BrowserData in a global eba file, but keep getting unknown - Type BrowserData, it all works Ok as a single file

sapero

Hi Pip, maybe you just forgot to include the file with your UDT definition, before using it?
$include "structures.inc" ' BrowserData
def browser[99,10]:BrowserData

LarryMc

did you include your global.eba file in your other project files?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Pip1957

Yes included all files, the error shows in when compiling the global eba file, where the def statement is.
Had the same error with a differnt array def eds[99]:edits and changed that to a pointer and used eds=new(edits,99) but can't use new with multi dimension array.

LarryMc

can you post your inc and global.eba files?  If not, email it to me and I'll see if I can figure it out.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Pip1957

here is the inc file

autodefine "off"

CONST MF_BYPOSITION = 0x400
' Control constants
CONST I_NAME = 1
CONST I_DEPOT = 2
CONST I_NUM = 3
CONST W_CLOSE = 1
Const ST_TITLE = 10
CONST ST_QUESTION = 20
CONST GB_MAIN = 21
CONST GB_QUESTION = 22
CONST BN_RESULTS = 23
CONST BN_ENTER = 24
CONST BN_STATUS = 25
CONST BN_CONTINUE = 26
CONST BN_INFO = 27
CONST BN_SKIP = 28
CONST BN_VIEW = 29
CONST ST_TRUE = 30
CONST ST_FALSE = 31
CONST ST_SMALLPIC = 50
CONST ST_SMALLPIC_1 = 51
CONST ST_DIAGRAM = 60
' /// radio buttons
CONST RB_ANSWER_1 = 100
CONST RB_ANSWER_2 = 101
CONST RB_ANSWER_3 = 102
CONST RB_ANSWER_4 = 103
CONST RB_ANSWER_5 = 104
CONST RB_ANSWER_6 = 105
CONST RB_ANSWER_7 = 106
CONST RB_ANSWER_8 = 107
CONST RB_ANSWER_9 = 108
CONST RB_ANSWER_10 = 109
' /// checkbox buttons
CONST CB_ANSWER_1 = 200
CONST CB_ANSWER_2 = 201
CONST CB_ANSWER_3 = 202
CONST CB_ANSWER_4 = 203
CONST CB_ANSWER_5 = 204
CONST CB_ANSWER_6 = 205
CONST CB_ANSWER_7 = 206
CONST CB_ANSWER_8 = 207
CONST CB_ANSWER_9 = 208
CONST CB_ANSWER_10 = 209
' /// true/false buttons
CONST RB_TRUE_1 = 300
CONST RB_TRUE_2 = 301
CONST RB_TRUE_3 = 302
CONST RB_TRUE_4 = 303
CONST RB_TRUE_5 = 304
CONST RB_TRUE_6 = 305
CONST RB_TRUE_7 = 306
CONST RB_TRUE_8 = 307
CONST RB_TRUE_9 = 308
CONST RB_TRUE_10 = 309

CONST RB_FALSE_1 = 310
CONST RB_FALSE_2 = 311
CONST RB_FALSE_3 = 312
CONST RB_FALSE_4 = 313
CONST RB_FALSE_5 = 314
CONST RB_FALSE_6 = 315
CONST RB_FALSE_7 = 316
CONST RB_FALSE_8 = 317
CONST RB_FALSE_9 = 318
CONST RB_FALSE_10 = 319
' /// bitmap question buttons
CONST BM_QUESTION_1 = 400
CONST BM_QUESTION_2 = 401
CONST BM_QUESTION_3 = 402
CONST BM_QUESTION_4 = 403
CONST BM_QUESTION_5 = 404
CONST BM_QUESTION_6 = 405
CONST BM_QUESTION_7 = 406
CONST BM_QUESTION_8 = 407
CONST BM_QUESTION_9 = 408
CONST BM_QUESTION_10 = 409
' /// bitmap answer buttons
CONST BM_ANSWER_1 = 500
CONST BM_ANSWER_2 = 501
CONST BM_ANSWER_3 = 502
CONST BM_ANSWER_4 = 503
CONST BM_ANSWER_5 = 504
CONST BM_ANSWER_6 = 505
CONST BM_ANSWER_7 = 506
CONST BM_ANSWER_8 = 507
CONST BM_ANSWER_9 = 508
CONST BM_ANSWER_10 = 509
' /// drag/drop statics
CONST ST_ACTION_1 = 600
CONST ST_ACTION_2 = 601
CONST ST_ACTION_3 = 602
CONST ST_ACTION_4 = 603
CONST ST_ACTION_5 = 604
CONST ST_ACTION_6 = 605
CONST ST_ACTION_7 = 606
CONST ST_ACTION_8 = 607
CONST ST_ACTION_9 = 608
CONST ST_ACTION_10 = 609
' /// edit controls
CONST ED_ANSWER_1 = 700
CONST ED_ANSWER_2 = 701
CONST ED_ANSWER_3 = 702
CONST ED_ANSWER_4 = 703
CONST ED_ANSWER_5 = 704
CONST ED_ANSWER_6 = 705
CONST ED_ANSWER_7 = 706
CONST ED_ANSWER_8 = 707
CONST ED_ANSWER_9 = 708
CONST ED_ANSWER_10 = 709
' /// general statics
CONST ST_ANSWER_1 = 800
CONST ST_ANSWER_2 = 801
CONST ST_ANSWER_3 = 802
CONST ST_ANSWER_4 = 803
CONST ST_ANSWER_5 = 804
CONST ST_ANSWER_6 = 805
CONST ST_ANSWER_7 = 806
CONST ST_ANSWER_8 = 807
CONST ST_ANSWER_9 = 808
CONST ST_ANSWER_10 = 809
Const EqClose = 631
Const k125 = 632
Const S125 = 633
'/////layout 11 questions///////////
Const LA11_BQ_1 = 1000
Const LA11_BQ_2 = 1001
Const LA11_BQ_3 = 1002
Const LA11_BQ_4 = 1003
Const LA11_BQ_5 = 1004
Const LA11_BQ_6 = 1005
Const LA11_BQ_7 = 1006
Const LA11_BQ_8 = 1007
Const LA11_BQ_9 = 1008
Const LA11_BQ_10 = 1009
'/////layout 11 answers///////////
Const LA11_BA_1 = 1100
Const LA11_BA_2 = 1101
Const LA11_BA_3 = 1102
Const LA11_BA_4 = 1103
Const LA11_BA_5 = 1104
Const LA11_BA_6 = 1105
$define IDYES 6
$define IDNO 7
' Colour Definitions
const RED   = 0x0000FF
const GREEN = 0x00FF00
const BLUE  = 0xFF0000
const timer1 = 1
const timer2 = 2
' define variables to be used

Type Status_Draw
  Def couleur:UINT
  Def Texte:STRING
  Def Font:UINT
  Def Emplacement:UINT
EndType

Type DRAWITEMSTRUCT
  Def CtlType:UINT
  Def CtlID:UINT
  Def itemID:UINT
  Def itemAction:UINT
  Def itemState:UINT
  Def hwndItem:UINT
  Def hDC:UINT
  Def rcItem as WINRECT
  Def itemdata as POINTER
EndType

CONST SB_SETTEXTA = (WM_USER+1)
CONST SBT_OWNERDRAW = 0x1000
CONST SB_SETMINHEIGHT = (WM_USER+8)
CONST SB_SETICON = 1039
' Custom Type containing all info on each question
Type question
def     sect[100]:istring :'Section name also used for filename
def         qn[4]:istring :'Question number
def       many[4]:istring :'Amount of answers
def        cor[4]:istring :'Amount of correct answers
def      pic[200]:istring :'Small static graphic and large diagram/sceneario graphic
def     pic1[200]:istring :'Small top left graphic
def     layout[4]:istring :'Question format
def         tf[4]:istring :'True/False number of true answers
def        var[4]:istring :'vari drag/drop answers
def        q[500]:istring :'Question
def       a1[500]:istring :'Answer 1
def       a2[500]:istring :'Answer 2
def       a3[500]:istring :'Answer 3
def       a4[500]:istring :'Answer 4
def       a5[500]:istring :'Answer 5
def       a6[500]:istring :'Answer 6
def       a7[500]:istring :'Answer 7
def       a8[500]:istring :'Answer 8
def       a9[500]:istring :'Answer 9
def      a10[500]:istring :'Answer 10
def graphic1[200]:istring :'Graphic 1
def graphic2[200]:istring :'Graphic 2
def graphic3[200]:istring :'Graphic 3
def graphic4[200]:istring :'Graphic 4
def graphic5[200]:istring :'Graphic 5
def graphic6[200]:istring :'Graphic 6
def graphic7[200]:istring :'Graphic 7
def graphic8[200]:istring :'Graphic 8
def graphic9[200]:istring :'Graphic 9
def graphic10[200]:istring :'Graphic 10
def        scr[4]:istring
endtype
' Custom type containing your answers and correct answers
type answers
def answ1[500]:Istring :'\
def answ2[500]:Istring :'\\
def answ3[500]:Istring :'\\\
def answ4[500]:Istring :'\\\\
def answ5[500]:Istring :'\\\\\ Your Answers
def answ6[500]:Istring :'/////
def answ7[500]:Istring :'////
def answ8[500]:Istring :'///
def answ9[500]:Istring :'//
def answ10[500]:Istring :'/
def cor1[500]:Istring :'\
def cor2[500]:Istring :'\\
def cor3[500]:Istring :'\\\
def cor4[500]:Istring :'\\\\
def cor5[500]:Istring :'\\\\\ Correct Answers
def cor6[500]:Istring :'/////
def cor7[500]:Istring :'////
def cor8[500]:Istring :'///
def cor9[500]:Istring :'//
def cor10[500]:Istring :'/
endtype
type person
def name:string
def depot:string
def payno:string
endtype
type test
def check1[10]:string :'\
def check2[10]:string :'\\
def check3[10]:string :'\\\
def check4[10]:string :'\\\\
def check5[10]:string :'\\\\\ True/False checks
def check6[10]:string :'/////
def check7[10]:string :'////
def check8[10]:string :'///
def check9[10]:string :'//
def check10[10]:string :'/
endtype
type edits
def ed1 as string
def ed2 as string
def ed3 as string
def ed4 as string
def ed5 as string
def ed6 as string
def ed7 as string
def ed8 as string
def ed9 as string
def ed10 as string
endtype
type BrowserData
def border as window
def cont as window
def imagepath as string
def imageanswer as string
endtype

'externs
declare extern Info_Dialog()
declare extern Pic_Dialog()
declare extern Con_Dialog()
declare extern borderhandler()
declare extern browsehandler()



here is the globals file

PROJECTGLOBAL "ON"

DEF Origin_window:UINT
DEF Hstatus, hFontOld:UINT
def result[99]:int
def skip[99]:int
def conpos[99]:float
def Maindlg, Infodlg, PicDlg, ConDlg:dialog
def win:window
def weight[99] as float
def failfour, failfive as int
def gws1, gws2, gws3, gws4 as float
def na, nb, nc, nd:INT
def nm, nw, nh, Img:INT
def size[3], handle, skipit, conit:INT
def b, status2, temp7:INT
def temp11, once, yes, hGraphic:int
def check_1, check_2, check_3, check_4, check_5, check_6, check_7, check_8, check_9, check_10:string
def chk_1, chk_2, chk_3, chk_4, chk_5, chk_6, chk_7, chk_8, chk_9, chk_10:string
def dest, destination, filename, s$, tempfile, pic, mytest, GraphicPath, DataPath, edstr, tempname:string
def s, s1, s2, s3, s4, o, o1, o2, o3, o4, o5, o6, o7, o8:string
def score, dd, aa, bb, total, tot, answer, QNumber, ny, dur, run, nums[10], picts[10], skipped, showskip:int
def percent as float
def qa:BFILE
def hTrackbar:UINT
DEF cl, ct, cw, ch:uint
def l, t, w, h, pl,z,docs,ab:int
def file1, txtfile, infofile:file
def printresult[500], Url[500], zz:Istring
def a$, b$, lef$, righ$, vfile, stat, Drive, output, filenam, temp22, resultsdir:string
def yy as int
def info:pointer
def qnum:pointer
def ans:pointer
def eds:pointer

'def eds[99] as edits
def check:pointer
def Champ_0:Status_Draw
def Champ_1:Status_Draw
def Champ_2:Status_Draw
def pointeur_0:pointer
def pointeur_1:pointer
def pointeur_2:pointer
def browser[99,10]:BrowserData

PROJECTGLOBAL "OFF"


Here is the start of Main

$Main

$INCLUDE "windowssdk.inc"
$INCLUDE "Ddoc_p32.inc"
$include "trackbar.inc"
$include "Development.inc"
$include "DevelopmentGlobals.eba"
$USE "ddoc32.lib"
$use "ddoc_jpg.lib"
$use "winmm.lib"

$define IDYES 6
$define IDNO 7


qnum=new(question,99)
ans=new(answers,99)
check=new(test,99)
eds=new(edits,99)
info=new(person,1)

SETTYPE qnum,question
settype ans,answers
settype check,test
settype eds,edits
settype info,person

LarryMc

The type def is in the inc file.
There is no include file in your globals.eba file.
therefore, when globals is compiled it has no idea what Browser... is defined as.

I suggest putting a copy of the typedef at the beginning of the globals file.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Pip1957

Larry

That worked a treat thank you very much for your time. :D