A problem with records...

Gordon Guthrie, BTP, BT, SE <>
Fri Feb 13 16:47:15 CET 2004

I'm having a strange problem - which might be trivial stupidity on my part

I have defined a record as so:

-record(sms_message_out, {phonenumber, message}).

I try and create an instance of it with this line of code:

write_sms_message(PhoneNo, Message) ->
       Message = #sms_message_out{phonenumber = PhoneNo, message = Message},
% Bombs out here!

and I get this message:

ERROR erlang  code  crashed:
 File: appmod:0
Reason: {{badmatch,{sms_message_out,"234567","esdfgjmn"}},
Req: {http_request,'POST',{abs_path,"/smsout/smsout_post"},{1,1}}

I have looked at this til my head hurts and compared it to (successful)
record creations elsewhere in my code and I can't see anything wrong - but I
might just be bug blind...


Scottish Enterprise Network

Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
G2 8LU.
Tel:  +44 (0)141 248 2700.
Fax:  +44 (0)141 221 3217

message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.

More information about the erlang-questions mailing list