You would check if your character coordinates have gotten to a specific point.
if CharX > 640
Load a new Area
CharX = 0
endif
But in your case it's best to map out your terrain with an array first and use a grid check.
dim Map(100,100)
Map(100,50) = 1
if Map(CharX/16,CharY/16) = 1
Load a new Map
CharX = reset this value
CharY = reset this value
endif
To best create this kind of data you would need to create your own MapEditor or LevelEditor or what ever you wana call it. Here's a link to an older project we did but was never finished. It includes the open source RPG game and it's MapEditor, take a look if you want.
http://forum.thegamecreators.com/?m=forum_view&b=7&t=153114&p=0