It is not just a Glasgow landmark; it is a Glasgow legend, the address given by a procession of petty offenders charged with drunk and disorderly behaviour through most of this century.

A magistrate keen to get his name in the press can count on laughter in court with the admonition: ''Careful, or you'll get the place a bad name.'' Inevitably, in this city of illusion, they call it Heartbreak Hotel, focus of the well-loved tale in the taxi drivers' repertoire of the innocent stranger who asked where he could get a bed for the night to find himself conducted to the Great Eastern Hotel.

The great square building (tooled ashlar facade with rusticated quoins) perched on the south side of Duke Street is a solid slice of Glasgow's social history.

Built in 1849 as a five-storey cotton mill, it was designed by architect Charles Wilson as a fireproof building, with no inflammable material used in its construction.

It was converted to a hotel for working men in 1907 with the addition of a top storey and Baroque centrepiece. It slowly declined from a cheap dormitory-style hotel for those who could pay their way to a hostel for people who could not find anything better.

From the mid-80s, those who just wanted a place to lay their head between each day's drinking or begging were joined by the casualties of the reshaping of the welfare state.

It is entirely appropriate, then, that a group which takes a completely positive approach to care in the community should move in as overseer of the most radical chapter in the Great Eastern's history.

It is set to become an equally solid symbol of the new Glasgow. The city council has had plans to close it for at least 30 years, but, when it housed as many as 500 men, little could be done except environmental health inspections as it passed from one private owner to the next, most of whom did their best to sanitise conditions.

Three years ago, a combination of the power of the council, the experience of two housing associations, and the financial muscle of Scottish Homes came together in a plan to move out the residents, some of whom had been there for decades, and turn the old building (whose architectural and historical importance has gained it a B category listing) into flats.

It is now owned by the Milnbank Housing Association, which has just over 1000 houses, mainly renovated tenement flats, in the Dennistoun area and will eventually be added to its housing stock.

No plans have been drawn up as yet, but director Alan Benson thinks the building may be best suited to large flats, possibly with office space at ground level. That could be compatible with the development of the empty space of the former college goods yard for industrial use. BT is currently in discussions with the council on siting a call centre there.

Loretto Housing Association, which specialises in providing housing, with support where necessary, to adults in need, but particularly those with mental health problems, has taken over the task of rehousing the men from 100 Duke Street, as it resolutely calls the GEH.

Project leader Rhona Murray had an immediate sense of deja vu when she stepped through the battered front door. She was involved in the closure of the Castle Trades Hotel in Edinburgh's Grassmarket, and notes wryly that all such hostels were called hotels.

Both buildings were large and had been neglected in all sorts of ways for years, but the difference is that the Castle Trades was refurbished to accommodate the residents in six person flats. ''The conclusion I came to in Edinburgh was that the kind of accommodation we needed was the model that Loretto is working to,'' she says, with evident satisfaction at seeing it put into practice.

The model is to pepper-pot them through a development with mainstream tenants, who are not expected to be any more than good neighbours. Loretto's director, Simon Carr, concedes that there will always be a need for hostels in any city (Glasgow currently has 1500 bed spaces) but says no hostel can meet the complex needs of men who require individual packages of care.

Since Loretto bought the Great Eastern with the express aim of closing it down, the physical state of the building can be gauged from the fact that it has spent #700,000 on immediate repairs to bring it up to a basic standard for the 102 residents plus the changing occupants of the 10 crisis beds.

Moving out (half to Loretto accommodation and half to council houses) will be a slow process. So far, eight men who have spent large chunks of time in the Great Eastern have been rehoused in the bright new flats in Springburn, along with support staff who also move from the Great Eastern to a new base in the community.

Mr Archie Liddell is nervously hospitable, solicitously offering cups of coffee. He's had four months' practice at welcoming visitors to the first house he's been able to call home since he left his parents' house in Govan.

At 65, he is still a little bemused at finding himself a housing association tenant. He stayed in caravans, hostels, or more or less any old corner in Scotland and the North of England while laying electricity cables, preferring, he admits, to spend his money on drink rather than on accommodation.

In the super-neat front room, a couple of pairs of shoes are stacked underneath the telly, the only hint of his stake on the place. When he first moved in, recalled Ms Murray, he seemed literally transplanted to one chair, with his cup to hand, not daring to encroach on the rest of the room.

Now his daily round consists of going to the nearby shopping centre for his messages, going for walks, watching television and occasionally going for a pint. He regularly sees an old friend from the Great Eastern, but is quick to quash the idea that he left many friends behind when he left.

''I met a few beggars there,'' he says, admitting that he was no angel himself. ''I would drink super-lager to lull myself into believing I had no worries, but it goes for your legs.''

His groceries sometimes contain a carry-out of ''ordinary beer'', a source of concern to the support staff who thought he had stopped drinking when he moved in. His key worker, Mr Jonny Howes, says his drinking is much more contained in the flat than it was in the hostel where it would often be out of control.

Loretto's Simon Carr draws a distinction between support and control. ''It is important not to impose expectations on the tenants,'' he said, although the help and encouragement is designed to deflect the urge to drink to distance themselves from a problem. Mr Liddell says he values the home-helps for their regular appearances and their chat more than their domestic skills.

Tall and slim with neatly trimmed grey hair, Mr Stuart Syme is a middle-aged man with traces of a good-looking youth. Only the swollen purple nose and the overwhelming newness of everything he's wearing from blue suede boots to denim jacket give the game away. His is the usual tangled story, which he tells with the fluency of much practice punctuated by the halts of shame and memory lapse.

He is 45 and has been sober for seven months. Whenever he's tempted to head for the off-licence, he is stopped in his tracks by a photocopied black and white photograph pinned to the wall.

A meaningless grin in a bloated face fringed by long strands of grey hair springing out of a woollen hat is a desperate reminder of the state he was in 18 months ago.

That was the night he was brought to the Great Eastern by an old friend and his brother, both reformed alcoholics, who were determined he would not continue to sleep outside. Mr Syme abused them both for their trouble, although his brother was in tears.

His is not an uncommon story: a highly paid, but tough job in the steelworks, a short-lived marriage; redundancy, sobriety, retraining as a nurse; a new partner, a new job; a return to drinking, a falling-out, being sacked, moving south to a job which never materialised, coming home, failing to answer a court summons, failing to report to his social worker, a short jail term, spiralling downwards to homelessness and hopelessness. Now helped by an almost fanatical attendance at AA meetings, he is on course for a mainstream tenancy either with his old local authority or with Loretto.

Housing benefit is the cement which holds this policy together along with some of the transfer of resources from health to social work. It can be stretched to cover some of the staffing costs in housing projects and at the Great Eastern, where the men pay a service charge of #5.54 a week.

A ruling by the Divisional Court in July that housing benefit was primarily intended to pay for the bricks and mortar costs of housing has caused consternation among organisations, particularly housing associations, who have used it as a means of covering the staff costs where vulnerable people would not be able to live successfully in the community without support.

The Government has put into effect a transitional arrangement which will protect the status quo for a year, by which time an alternative package now being worked out by a consortium of government agencies will have been agreed.

The future of thousands of people depends on it.