Help creating procedures

new topic     » topic index » view thread      » older message » newer message

Hello all,

I am writng a program in DOS32 that displays bitmaps a lot and I am
attempting to write two procedures that will make this task easier to code.
My first procedure allows me to load a bitmap and display it at a certain
point on screen with one line of code:

procedure image(sequence name, integer x, integer y)

integer error
object bitmap

bitmap = read_bitmap(name & ".bmp")
error = sequence(bitmap)

if error = 0 then
    puts(1, "Error loading bitmap")
    abort(0)
else
    all_palette(bitmap[1] / 4)
    bitmap = bitmap[2]
    display_image({x,y}, bitmap)
end if

end procedure

Now I can call a bitmap and display it like so:
image("c:\\euphoria\\bitmaps\\test", 100, 100)

What I want to do now it have another procedure called address that would
allow me to list the address seperately and have image() use that each time
so that I do not have to type it repeatedly. Something like:

procedure address(sequence where_is_it)
end procedure

Used like so:

address("c:\\euphoria\\bitmaps\\")

My problem is that when I try to place where_is_it in procedure image() I am
informed that where_is_it has not been declared. I have been trying all
sorts of things but nothing solves the problem. This error is resulting
before the program even runs.

Any help?

Thank you,
David S.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu