SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Traversing a Multidimensional Array

    Hello friends,

    I need a little help with this one.

    I'm trying to build either an array or an object (at this point whatever works) that mimics this structure:

    Code:
    object{
    	country{
    		city{
    			zone1=1x;
    			zone2=2x;
    			zone3=3x;
    			zone4=4x;
    			zone5=5x;
    		}
    		city{
    			zone1=1x;
    			zone2=2x;
    			zone3=3x;
    			zone4=4x;
    			zone5=5x;
    		}
    	}
    	country{
    		city{
    			zone1=1x;
    			zone2=2x;
    			zone3=3x;
    			zone4=4x;
    			zone5=5x;
    		}
    	}
    }
    The point is I want to store certain "zone IDs" per city for each city in each one of the countries where our service is offered.

    I want to do this in the form of an array and in a separate file so the person maintaining it can add and remove countries, cities or zones at will.

    Then, in my code i need to find the zones for a particular city. This I can do by looking for the city name directly cause I know there wont be two cities with the same name ever.

    So lets say I have this:
    Code:
    my_service{
    	argentina{
    		buenos_aires{
    			zone1=438;
    			zone2=886;
    			zone3=334;
    			zone4=158;
    			zone5=754;
    		}
    		cordoba{
    			zone1=115;
    			zone2=754;
    			zone3=668;
    			zone4=356;
    			zone5=994;
    		}
    	}
    	chile{
    		santiago{
    			zone1=775;
    			zone2=789;
    			zone3=654;
    			zone4=864;
    			zone5=444;
    		}
    	}
    }
    ... and I retrieve the cookie called "city" which contains a string value equaling "cordoba".

    The questions

    1.- How do I actually write the array/oject?
    2.- How do I loop through the multidimensional array and retrieve the IDs?

    It might be simpler than what I think but I've tried a bunch of different ways without luck :S

    It'd be a lot easier (for me) in PHP but I have to use JavaScript this time.

    Thank you,
    Luis

  2. #2
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW don't worry about the cookie retrieval.... I have that code already.
    Luis

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a simple implementation; there are ways of doing this that are easier for the peson updating the file, but I'm sleepy (me: ) so, try this for now:
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>untitled</title>
    <script type="text/javascript">
    
    var my_service =
    {
    
    // ================================================== //
    
    	Argentina:
    	{
    		buenos_aires:
    		{
    
    			zone1: 438 ,
    			zone2: 886 ,
    			zone3: 334 ,
    			zone4: 158 ,
    			zone5: 754
    
    		},
    		cordoba:
    		{
    			zone1: 115 ,
    			zone2: 754 ,
    			zone3: 668 ,
    			zone4: 356 ,
    			zone5: 994
    		}
    	},
    
    // ================================================== //
    
    	Chile:
    	{
    		santiago:
    		{
    			zone1: 775 ,
    			zone2: 789 ,
    			zone3: 654 ,
    			zone4: 864 ,
    			zone5: 444
    		}
    	}
    
    // ================================================== //
    
    }
    
    function getzones(oSelect)
    {
    	var cityobj;
    	var cityname = oSelect.options[oSelect.selectedIndex].value;
    	var citytext = oSelect.options[oSelect.selectedIndex].text;
    	var countryname = 'Argentina';
    	if (cityobj = my_service[countryname][cityname])
    	{
    		var str = 'These are the zones for ' + citytext + ', ' + countryname + ':\n\n';
    		for (zone in cityobj)
    			str += '> ' + cityobj[zone] + '\n';
    		alert(str);
    	}
    }
    
    </script>
    </head>
    <body>
    <form>
    <select onchange="return getzones(this)">
    <option value="" selected="selected">- select city -</option>
    <option value="buenos_aires">Buenos Aires</option>
    <option value="cordoba">Cordoba</option>
    </select>
    </form>
    </body>
    </html>
    
    Probably use 'dependent selects' for the country/city filtering; I just hardcoded it ('Argentina') for the time being. htw

    http://www.zonageek.com/articulos/ja...t_ii/index.php
    http://www.google.com/search?hl=en&l...=Google+Search
    Last edited by adios; Mar 15, 2004 at 12:03.
    ::: certified wild guess :::

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very slick, adios

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mike, I love you. Stop it.
    lgomez: OK, fleshed this out a bit. Help yourself.
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>// dem zones //</title>
    <style type="text/css">
    
    body {
    	background: background;
    }
    hr {
    	color: buttonshadow;
    }
    #deadfish {
    	margin: 50px auto;
    	padding: 16px;
    	background: buttonface;
    	border: 5px #fff groove;
    	border-collapse: collapse;
    }
    #deadfish th {
    	font: bold 14px "times new roman", serif;letter-spacing:.4em;
    	color: infotext;
    	padding: 12px 6px 0 6px;
    }
    #deadfish td {
    	padding: 8px 16px;
    	text-align: center;
    }
    #deadfish select {
    	width: 210px;
    	font: normal 13px "times new roman", serif;
    	color: infotext;
    	background: infobackground 
    }
    #readout {
    	height: 24px;
    	font: normal 13px "times new roman", serif;
    	text-align: center;
    	color: infotext;
    }
    .zones {
    	font: bold 11px verdana, sans-serif;
    	text-align: center;
    }
    .accent {
    	color: #700;
    }
    
    </style>
    <script type="text/javascript" src="zones.js"></script>
    </head>
    <body onload="document.forms[0].reset()">
    <form>
    <table id="deadfish">
    <tr>
    <th>&#164; Country &#164;</th>
    <th>&#164; City &#164;</th>
    </tr><tr>
    <td>
    <select name="country" size="1" onchange="return set_cities(this, city)">
    <option value="" selected="selected"> choose -----------> COUNTRY </option>
    <option value=""></option>
    <option value="Argentina">Argentina</option>
    <option value="Chile">Chile</option>
    <option value="Alabama">Alabama</option>
    </select>
    </td>
    <td>
    <select name="city" size="1" style="background:highlight;" onchange="return get_zones(this, country)">
    </select>
    </td>
    </tr><tr>
    <td id="readout" colspan="2">&nbsp;</td>
    </tr>
    </table>
    </form>
    </html>
    
    [zones.js]
    Code:
    
    /*
     **************
     *  zones.js  *
     **************
                  */
    
    
    /* START template
    
    // ================================================== //
    
    	"[COUNTRY]" :
    	{
    		"[CITY]" :
    		{
    
    			zone1: [number] ,
    			zone2: [number] ,
    			zone3: [number] ,
    			zone4: [number] ,
    			zone5: [number] <--------- no comma after last!
    
    		}, <--------- no comma after last!
    
    // ================================================== //
    
    END template */
    
    
    var my_service =       /* [zone collection] */
    {
    
    // ================================================== //
    
    	"Argentina" :
    	{
    		"Buenos Aires" :
    		{
    
    			zone1: 438 ,
    			zone2: 886 ,
    			zone3: 334 ,
    			zone4: 158 ,
    			zone5: 754
    
    		},
    		"Cordoba" :
    		{
    			zone1: 115 ,
    			zone2: 754 ,
    			zone3: 668 ,
    			zone4: 356 ,
    			zone5: 994
    		}
    	},
    
    // ================================================== //
    
    	"Chile" :
    	{
    		"Santiago" :
    		{
    			zone1: 775 ,
    			zone2: 789 ,
    			zone3: 654 ,
    			zone4: 864 ,
    			zone5: 444
    		},
    		"Viña del Mar" :
    		{
    			zone1: 743 ,
    			zone2: 722 ,
    			zone3: 611 ,
    			zone4: 908 ,
    			zone5: 276
    		}
    	},
    
    // ================================================== //
    
    	"Alabama" :
    	{
    		"Eclectic" :
    		{
    			zone1: "no telephones yet !"
    		},
    		"Lacey's Spring" :
    		{
    			zone1: "no telephones yet !"
    		},
    		"Loachapoka" :
    		{
    			zone1: "no telephones yet !"
    		},
    		"Phil Campbell" :
    		{
    			zone1: "no telephones yet !"
    		},
    		"Sylacauga" :
    		{
    			zone1: "no telephones yet !"
    		},
    		"Valley Head" :
    		{
    			zone1: "no telephones yet !"
    		}
    	}
    
    // ================================================== //
    
    }
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    function set_cities(oCountrySel, oCitySel)
    {
    	var cityArr, i, cities, country = oCountrySel[oCountrySel.selectedIndex].text;
    	if (country == '')
    	{
    		oCountrySel.selectedIndex = 0; //reset
    		return;
    	}
    	oCitySel.length = 0; //clear list
    	oCitySel.style.background = '#fff'; //'active' BG
    	if (country = my_service[country]) //hash exists, assign
    	{
    		oCitySel.options[0] = new Option(' select -----------> CITY ', ''); //dummy
    		oCitySel.options[1] = new Option('', ''); //blank dummy
    		for (city in country)
    			oCitySel.options[oCitySel.options.length] = new Option(city, city); //populate
    	}
    	document.getElementById('readout').innerHTML = oCountrySel[oCountrySel.selectedIndex].text; //print
    }
    
    function get_zones(oCitySel, oCountrySel)
    {
    	if (oCitySel.options[oCitySel.selectedIndex].value == '')
    	{
    		oCitySel.selectedIndex = 0;
    		return;
    	}
    	var cityobj;
    	var cityname = oCitySel.options[oCitySel.selectedIndex].text; //get city
    	var countryname = oCountrySel.options[oCountrySel.selectedIndex].text; //get country
    	if (cityobj = my_service[countryname][cityname]) //plug in to object, assign
    	{
    		var zoneHTML = 'These are the zones for ' + cityname + ', ' + countryname + ':<hr />';
    		zoneHTML += '<span class="zones">';
    		for (zone in cityobj)
    			zoneHTML += '> ' + cityobj[zone] + '<br />'; //loop, enumerate
    		zoneHTML += '<span>';
    		document.getElementById('readout').innerHTML = zoneHTML; //print
    	}
    }
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    Last edited by adios; Mar 16, 2004 at 10:13.
    ::: certified wild guess :::

  6. #6
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    Yes, sometimes we do act like Alabama is a country

    The only problem is... "no telephones yet !"



    Oh, and don't forget these famous Alabama towns: Rabbit Town, Lickskillet, B F Egypt, Op (rattlesnake rodeos), Oneonta (I did alot of growing up here), Whitesboro (not a town, but its the community I live in).

    Oh, and don't forget Florabama! Oh yeah!

    Ok, enough fun, I gotta get back to work

  7. #7
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Florabama sounds like fun.

    Probably not as much fun as Valley Head, however.
    ::: certified wild guess :::

  8. #8
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    Oh, Florabama is much more fun. Its on the line between Forida and Alabama, and there's a really nice club right on the beach

    lgomez, sorry for taking this thread WAY off topic It's been one of those days

  9. #9
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alrighty, back from Valley Head and ON-topic again...this might help 'the person maintaining it [to] add and remove countries, cities or zones at will.'
    Code:
    
    //////////////
    // zones.js //
    //////////////
    
    var my_service = [];
    var country, city;
    Array.prototype.add_country = function(sCountryName)
    {
    	return (this[sCountryName] = []);
    }
    
    Array.prototype.add_city = function(sCityName)
    {
    	return (this[sCityName] = []);
    }
    
    Array.prototype.add_zones = function( /* zone name, zone number pairs */ )
    {	
    	var a = 0;
    	for (a; a < arguments.length; a += 2)
    		this[arguments[a]] = arguments[a + 1];
    }
    
    function set_cities(oCountrySel, oCitySel)
    {
    	oCitySel.length = 0; //clear list
    	if (oCountrySel.selectedIndex < 2)
    	{
    		oCountrySel.selectedIndex = oCitySel.selectedIndex = 0; //reset
    		oCitySel.style.background = 'highlight'; //'inactive' BG
    		document.getElementById('readout').innerHTML = '';
    		return;
    	}
    	oCitySel.style.background = 'infobackground'; //'active' BG
    	var country = oCountrySel[oCountrySel.selectedIndex].text;
    	if (country = my_service[country]) //hash exists, assign
    	{
    		oCitySel.options[0] = new Option(' choose -----------> CITY ', ''); //dummy
    		oCitySel.options[1] = new Option('', ''); //blank dummy
    		var city;
    		for (city in country)
    		{
    			if (typeof country[city] != 'function') //skip methods
    				oCitySel.options[oCitySel.options.length] = new Option(city, city); //populate
    		}
    	}
    	var sHTML = '<span class="accent">' + oCountrySel[oCountrySel.selectedIndex].text + '</span>';
    	document.getElementById('readout').innerHTML = sHTML; //print
    }
    
    function get_zones(oCitySel, oCountrySel)
    {
    	if (oCitySel.selectedIndex < 2)
    	{
    		oCitySel.selectedIndex = 0;
    		document.getElementById('readout').innerHTML = '';
    		return;
    	}
    	var cityobj;
    	var cityname = oCitySel.options[oCitySel.selectedIndex].text; //get city
    	var countryname = oCountrySel.options[oCountrySel.selectedIndex].text; //get country
    	if (cityobj = my_service[countryname][cityname]) //plug in to object, assign
    	{
    		var zoneHTML = 'These are the zones for <span class="accent">';
    		zoneHTML += cityname + ', ' + countryname + '</span>:<hr />';
    		zoneHTML += '<div class="zones">';
    		for (zone in cityobj)
    		{
    			if (typeof cityobj[zone] != 'function') //skip methods
    			{
    			zoneHTML += zone + ' <span class="accent">»</span> '; //loop, enumerate
    			zoneHTML += cityobj[zone] + '<br />';
    			}
    		}
    		zoneHTML += '</div>';
    		document.getElementById('readout').innerHTML = zoneHTML; //print
    	}
    }
    
    
    // customize /////////////////////////////////////////////////////////////////////
    
    country = my_service.add_country("Argentina");
    
    city = country.add_city("Buenos Aires");
    city.add_zones("zone 1",438,"zone 2",886,"zone 3",334,"zone 4",158,"zone 5",754);
    city = country.add_city("Cordoba");
    city.add_zones("zone 1",115,"zone 2",754,"zone 3",668,"zone 4",356,"zone 5",994);
    
    
    country = my_service.add_country("Chile");
    
    city = country.add_city("Santiago");
    city.add_zones("zone 1",775,"zone 2",789,"zone 3",654,"zone 4",864,"zone 5",444);
    city = country.add_city("Viña del Mar");
    city.add_zones("zone 1",743,"zone 2",722,"zone 3",611,"zone 4",908,"zone 5",276);
    
    
    country = my_service.add_country("Alabama");
    
    city = country.add_city("Eclectic");
    city.add_zones("zone 1","no telephones yet !");
    city = country.add_city("Lacey's Spring");
    city.add_zones("zone 1","no telephones yet !");
    city = country.add_city("Loachapoka");
    city.add_zones("zone 1","no telephones yet !");
    city = country.add_city("Phil Campbell");
    city.add_zones("zone 1","no telephones yet !");
    city = country.add_city("Sylacauga");
    city.add_zones("zone 1","no telephones yet !");
    city = country.add_city("Valley Head");
    city.add_zones("zone 1","no telephones yet !");
    
    //////////////////////////////////////////////////////////////////////////////////
    
    Last edited by adios; Mar 16, 2004 at 10:20.
    ::: certified wild guess :::

  10. #10
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wow...

    I'm sorry friends, I didn't realized I did not turn on the subscription to this post so never came back thinking that it had no replies.

    It looks great... I'm going to implement it between next monday and wednesday. I'll let you know so you can check it out.

    Thank you very much.
    Luis

  11. #11
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, what you'll see here is clearly different from what you showed me. The requirements changed a bit and the client's designer want's to be able to edit the zonez.js file using the format that you see bellow.

    Here are the files:

    zonez.js
    Code:
    var tutopia=[];
    //Default Country
    tutopia['default_country']=[];
    tutopia['default_country']['default_city']=['default_city','3','32','118','297','298','299','281','282','283','284','296','0'];
    //Argentina
    tutopia['Argentina']=[];
    tutopia['Argentina']['default_city']=['default_city','3','32','118','297','298','299','281','282','283','284','296','0'];
    tutopia['Argentina']['Buenos Aires']=['ARBUE'];
    tutopia['Argentina']['Bahia Blanca']=['ARBAH'];
    //Bolivia
    tutopia['Bolivia']=[];
    tutopia['Bolivia']['default_city']=['default_city','3','32','118','297','298','299','281','282','283','284','296','0'];
    tutopia['Bolivia']['La Paz']=['BOLPAZ'];
    //Brasil
    tutopia['Brasil']=[];
    tutopia['Brasil']['default_city']=['default_city','3','32','118','297','298','299','281','282','283','284','296','0'];
    tutopia['Brasil']['BRSAOPA']=['BOLPAZ'];
    default.js
    Code:
    function setCity(cookieName,cookieValue,nDays) {
     var today = new Date();
     var expire = new Date();
     if (nDays==null || nDays==0) nDays=1;
      expire.setTime(today.getTime() + 3600000*24*nDays);
     document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
     document.location=document.location;
    }
    function readCity(cookieName) {
     var theCookie=""+document.cookie;
     var ind=theCookie.indexOf(cookieName);
     if (ind==-1 || cookieName=="") return ""; 
      var ind1=theCookie.indexOf(';',ind);
     if (ind1==-1) ind1=theCookie.length; 
      return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
    }
    function cities(zonesArray){
     var output='';
     for(country in zonesArray){
      if(country!='default_country'){
       output+='<optgroup label="'+country+'">';
       for(city in zonesArray[country]){
    	if(city!='default_city'){
    	 output+='<option value="'+zonesArray[country][city][0]+'" id="'+zonesArray[country][city][0]+'"';
    	 if(readCity('city')==zonesArray[country][city][0]){
    	  output+=' selected';
    	 }
    	 output+='>'+city+'</option>';
    	}
       }
       output+='</optgroup>';
      }
     }
     document.write(output);
    }
    zones.htm
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <script type="text/javascript" src="zones.js" language="javascript"></script>
    <script type="text/javascript" src="default.js" language="javascript"></script>
    </head>
    <body>
    <form name="cityForm" method="post" action="">
     <select name="city" onChange="setCity('city',this[selectedIndex].value,30);" 
    style="font-size:9px;font-family:Verdana, Arial, Helvetica, sans-serif;">
      <option value="">Selecciona tu ciudad</option>
      <script type="text/javascript">cities(tutopia);</script>
     </select>
    </form>
    </html>
    So that you understand better, the whole point of this page is to offer internet access in certain regions of latin america. Until now they managed the 80+ portals (one per city) using dreamweaver templates. That simplified the process a lot but the templates became too complex to edit (and slow).

    So we decided to use a single page and use javascript to set a number of variables that contain the IDs for each zone.

    Zones are pieces of code that take care of pulling content from a separate sistem. Some of it may be ads and some may be actual content. The only difference between zones is the zoneI. Here is the code that makes the zones work:

    Header:
    Code:
    <script language="JavaScript" type="text/javascript">
     <!--
     function bmpZone(id,width,height){
      var browName = navigator.appName;
      var browDateTime = (new Date()).getTime();
      var browVersion = parseInt(navigator.appVersion);
      var ua=navigator.userAgent.toLowerCase();
      var adcode='';
      if (browName=='Netscape'){
      if (browVersion>=5) 
      { document.write('<ifr'+'ame src="http://www.tutopia.com/bannerserving/banman.asp?ZoneID='+id+'&Task=Get&Browser=NETSCAPE6&X=' + browDateTime + '" 
    width='+width+' height='+height+' Marginwidth=0 Marginheight=0 Hspace=0 
    Vspace=0Frameborder=0 Scrolling=No></ifr'+'ame>');  }
      else if ((browVersion>=4)&&(ua.indexOf("mac")==-1))
      { document.write('<S'+'CRIPT src="http://www.tutopia.com/bannerserving/banman.asp?ZoneID='+id+'&Task=Get&Browser=NETSCAPE4">');
      document.write('</'+'scr'+'ipt>');
      document.write(adcode); }
      else if (browVersion>=3) 
      { document.write('<A HREF="http://www.tutopia.com/bannerserving/banman.asp?ZoneID='+id+'&Task=Click&Mode=HTML&PageID=44635&RandomNumber='  + browDateTime + 
    '" target="_new"><IMG SRC="http://www.tutopia.com/bannerserving/banman.asp?ZoneID='+id+'&Task=Get&Mode=HTML&PageID=44635&RandomNumber=' + browDateTime +
     '" width="'+width+'" height="'+height+'" border="0"></A>'); } }
      if (browName=='Microsoft Internet Explorer')
      { document.write('<ifr'+'ame src="http://www.tutopia.com/bannerserving/banman.asp?ZoneID='+id+'&Task=Get&X=' + browDateTime +
     '"width= '+width+' height='+height+' Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No></ifr'+'ame>'); }
     }
     // --> 
    </script>
    zone:
    Code:
    <script>bmpZone(tutopia[readCity('city')][0],468,60);</script>
    So... Ideally what I want to have is the zones.js file for them to add zoneIDs per city, the zones.htm file that will eventually become the index file and a default.js file that contains the actual javascript that does the work.

    In the code you see above there is one important factor that I need to implement (which is what I'm trying to do now). I want to have an entry for each country and city but have the program use IDs for the country's "default_city" when an ID is not available for the selected city. That way there can be "country-wide" IDs set in say:
    Code:
    tutopia['Argentina']['default_city']=['default_city','3','32','118','297','298','299','281','282','283','284','296','0'];
    And "city-specific" overrides like:
    Code:
    tutopia['Argentina']['Buenos Aires']=['ARBUE','3','32','','297','298','','281','282','283','284','296','0'];
    Taking into account that the template for a city entry is:
    Code:
    service['Country name']['City name']=['CITYCODE',ID1,ID2,ID3,ID4,ID5,ID6,ID7,ID8,ID9,ID10,ID11,ID12];
    ID3 and ID6 in Buenos Aires would fall-back to ID3 and ID6 in the "default_city" for Argentina.

    A default country is added only to cover missing IDs in a "default_city" specification. Sugestions are welcome...

    I'm going to shut up now... just wanted to share this with you to show my appreciation for your help. I'm gonna go pay my dues by helping someone else in this forum...

    Thank you!
    Luis


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •