Wondering if anyone can assist
I am utilizing some code from RIAForge which integrates with the Last.fm api...
One of the methods outputs as a struct, but I would like to modify the code so it outputs as an array, am unsure of how to do this..
Currently the code is like this
<cfscript>
var args = StructNew();
var returnStruct = StructNew();
var results = "";
var i = 0;
args['playlistURL'] = arguments.playlistURL;
results = super.callMethod('playlist.fetch', args).playlist;
returnStruct['title'] = results[':title'];
returnStruct['annotation'] = results[':annotation'];
returnStruct['creator'] = results[':creator'];
returnStruct['date'] = results[':date'];
if(StructKeyExists(results, ':trackList') AND StructKeyExists(results[':trackList'], ':track')){
results = super.ensureArray(results[':trackList'][':track']);
returnStruct['tracks'] = QueryNew('album,creator,duration,identifier,image,info,title');
for(i=1; i LTE ArrayLen(results); i=i+1){
QueryAddRow(returnStruct.tracks);
QuerySetCell(returnStruct.tracks, 'album', results[i].album);
QuerySetCell(returnStruct.tracks, 'creator', results[i].creator);
QuerySetCell(returnStruct.tracks, 'duration', results[i].duration);
QuerySetCell(returnStruct.tracks, 'identifier', results[i].identifier);
QuerySetCell(returnStruct.tracks, 'image', results[i].image);
QuerySetCell(returnStruct.tracks, 'info', results[i].info);
QuerySetCell(returnStruct.tracks, 'title', results[i].title);
}
}
return returnStruct;
Am just wondering if there is a coldfusion method that allows me to convert the returnStruct into a query..
Many thanks