🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #3131

Re: Problem with the WSPrintF function

#3131
From: Bob SCHMIDT
Date: Fri, 07 Jun 1991 03:15
28 lines
1355 bytes
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!
Technical Details
Message-ID: <72795@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!microsoft!bobsc
References: <91156.084930F0O@psuvm.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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