Keith_boys Posted April 22, 2004 Posted April 22, 2004 Does anyone know how to redimmension arrays in J#? i'm trying to translate from c to j and it's not working. i'd appreciate any help. thanks. Quote
Leaders Iceplug Posted April 22, 2004 Leaders Posted April 22, 2004 I don't know if there's a prettier way to do this, but you can create a new array and assign the elements from the old into the new. [color=DarkSlateBlue]int[/color] sectou[] = {10, 20, 30, 40, 50, 60}; [color=DarkOrchid]// Old array above, new array below.[/color] [color=DarkSlateBlue]int[/color] sector[] = [color=DarkSlateBlue]new int[/color][7]; System.Array.Copy(sectou, 0, sector, 0, 6); [color=DarkOrchid]// Copies in the old elements.[/color] If you only want a bigger array, the new int[##] part should work for you. Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Keith_boys Posted April 23, 2004 Author Posted April 23, 2004 it's public thanks for the suggestion, but the problem with that, is that the array i'm trying to redimension is public. Quote
Leaders Iceplug Posted April 23, 2004 Leaders Posted April 23, 2004 Oh, then just swap them at the end: sectou = sector :). Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.