If String is instantiated, unifies Codes with the list whose elements are the character codes for the character in the string.
If Codes is instantiated, unifies String with the string composed from the character codes given by the list elements.
Success:
string_codes(S,[65,98,99]). (gives S="Abc").
string_codes("abc",L). (gives L=[97,98,99]).
string_codes("abc",[97,A,99]). (gives A=98).
string_codes(S,[127]). (gives S="\177").
string_codes("abc",[97|A]). (gives A=[98,99]).
Fail:
string_codes("abc",[98,99,100]).
Error:
string_codes(S,[A|[128]]). (Error 4).
string_codes(S,[1|A]). (Error 4).
string_codes('string',L). (Error 5).
string_codes(S,"list"). (Error 5).
string_codes('string',[128]). (Error 5).
string_codes(S,["B"]). (Error 5).
string_codes(S,[256]). (Error 6).