Search the web
Sign In
New User? Sign Up
GPCP · Gardens Point Component Pascal
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Is this a GPCP bug?   Message List  
Reply | Forward Message #424 of 437 |
Hi all,

I noticed that if I assign a System.String to NIL,
the code will crash with an error in RTS.dll. I'm
wondering if this is a GPCP bug, of I am misunderstanding
what I can do with a System.String?

Example code:

MODULE Hello;

IMPORT System := "[mscorlib]System", CPmain;

VAR
str: System.String;
BEGIN
str := NIL;
System.Console.WriteLine( str );
END Hello.

Debugger error message at "str := NIL":

An unhandled exception of type 'System.NullReferenceException'
occurred in RTS.dll

Thanks!

Marc



Wed Jul 1, 2009 6:02 pm

marcmartin2
Offline Offline
Send Email Send Email

Forward
Message #424 of 437 |
Expand Messages Author Sort by Date

Hi all, I noticed that if I assign a System.String to NIL, the code will crash with an error in RTS.dll. I'm wondering if this is a GPCP bug, of I am...
Marc Martin
marcmartin2
Offline Send Email
Jul 1, 2009
6:06 pm

... There is no problem assigning NIL to str, but there certainly is a problem if you then try to access that variable. Efectively you are telling the system...
cfbsoftware1
Offline Send Email
Jul 2, 2009
12:29 am

... Yes, in the original code, this was part of an initialization sequence. The debugger claims that the crash happens with the assignment, not with an access....
Marc Martin
marcmartin2
Offline Send Email
Jul 2, 2009
1:48 am

... Sorry, my mistake, I misread your original message. Your question makes a lot more sense to me now! You are right - it shouldn't crash when you assign: str...
cfbsoftware1
Offline Send Email
Jul 2, 2009
2:42 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help