Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Container Types
#1
I'm working on something that needs multiple buffers, so I build a bunch of containers, but I'm getting an error in my setup SUB. The first line shown here works, but the second line gives this error:
D:\FBIDETEMP.o.fake:(.text+0x397): undefined reference to 'PAGES'

Code:
progs(x).win.x = 134
      GET(0,0)-(799, 574), progs(x).win.pages(0,0)

Here are the declarations:


Code:
Type wins
    x as integer
    y as integer
    pages(460001, 1) as integer  '2 pages
End type
Type program
   win as wins
End Type
DIM progs(15) as program

Why can it find x but not pages?
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#2
Maybe it's your lines:
"Type wins"
...
"progs(x).win.pages(0,0)"
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#3
progs is a container of a wins, named win. Look in the Program Type
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#4
oOps, I made a mistake. Oh well.

That should work. I'm not sure why it is messing up. Anyway, if I remove the array part to make "pages" a normal variable (pages rather than pages() ), it renders an error on the same line. It expects an identifier. The only acceptable identifier is progs(x)
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#5
Code:
Type wins
x As Integer
y As Integer
pages(460001, 1) As Integer '2 pages
End Type
Type program
win As wins
End Type

ScreenRes 800, 575

Randomize Timer

For t = 0 To 99999

  PSet ( Int( Rnd * 800 ), Int( Rnd * 575 ) ), Int( Rnd * 255 )

Next

Dim progs(15) As program

progs(0).win.x = 134


Get(0,0)-(799, 574), @progs(0).win.pages(0,0)

Sleep

Cls

Sleep        
        
Put(0,0), @progs(0).win.pages(0,0)

Sleep

get and put take pointers. since your array is in a type, you must pass a pointer to the memory location. it works a bit differently when you pass structures like that
Reply
#6
:oops: I forgot it passes by reference
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)