Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!microsoft!bobsc From: bobsc@microsoft.UUCP (Bob SCHMIDT) Newsgroups: comp.windows.ms.programmer Subject: Re: Problem with the WSPrintF function Message-ID: <72795@microsoft.UUCP> Date: 7 Jun 91 03:15:52 GMT References: <91156.084930F0O@psuvm.psu.edu> Reply-To: bobsc@microsoft.UUCP (Bob SCHMIDT) Organization: Microsoft Corp., Redmond WA Lines: 28 In article <91156.084930F0O@psuvm.psu.edu> F0O@psuvm.psu.edu writes: [editted for brevity] %% Procedure TMyWindow.WMLButtonDown(Var TextString: PChar); %% VAR %% S: PChar; %% BEGIN %% WVSPrintF(S, '%s', TextString); %% END; %% %% When Windows hits the WVSPrintF statement, I get a UAE. By running %% in the debugger, the UAE is reported as exception code 13, a memory %% addressing error. Tim -- I may totally off-base here (after all, I work for Microsoft, and this is about a Borland product ;-), but it looks like you have no storage reserved for your string buffer. I'm guessing that type 'PChar' is pointer to a character (or character array). Try defining your buffer to be var S : array[0..N] of char; {where N is big enough to avoid UAEs!} If 'S' is a pointer to an array, then I'd think 'new(S)' (or the Borland variant) should work also. ...Hope this helps!