Jump to content

Form not showing in browser

Recommended Posts

just discovered why this happens.

I have this declaration in the file added to the uses clause:



aRecord = record

string1, string2 :string;



It should have been


aRecord : record

string1, string2:string;



Shouldn't SMS detect the previous declaration as a Syntax Error?

Link to post
Share on other sites

Both forms are correct, though your first form fails because of a bug in the codegen that has since been fixed.


The first form (var aRecord = record ...) declares and initialized a variable to an anonymous record type (http://delphitools.info/2012/05/29/fields-default-values-anonymous-records/), while the second form (var aRecord : record ...) declares a variable of an anonymous record type (no initialization).


In both cases, the record type is anonymous because it's not named, it would be named if you had declared it with "type TMyRecordTypeName = record ...".



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...