All pastes #28304 Raw Edit

Map Save Code

public text v1 · immutable
#28304 ·published 2005-11-10 22:47 UTC
rendered paste body
proc saveMap (var savebutton : boolean)
    var filename : string := ""
    var output : int
    mousewhere (mx, my, mb)
    drawbox (50, 250, 100, 275, black)
    drawfill (51, 251, red, black)
    Draw.Text ("SAVE", 55, 255, font1, black)
    if mx >= 50 and mx <= 100 and my >= 250 and my <= 275 and mb = 1 then
        locate (1, 1)
        put "Enter a name: " ..
        get filename
        open : output, filename + ".map", put
        for i : 1 .. 40
            for j : 1 .. 40
                %put map (i, j), " " ..
                put : output , map (i, j), " " ..
            end for
        end for
        close : output
    end if    
end saveMap