Getting info from a Global

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2133

    Getting info from a Global

    Attempting to load an image from a file that a global function finds:


    function GetCityInfo(cityname)
    --Remove the Button text from the end of the button name
    local strCityName = String.Replace(cityname, " Button", "", false);
    -- Check to see if a text file exists within that folder
    local bCityFound = File.Find("AutoPlay\\citys\\"..strCityName, strCityName..".txt", false, false, nil);
    -- If it exists then jump to the citys page and return the string with the City Name
    if bCityFound then
    --Page.Jump("citys");
    return strCityName, "citys";
    else
    return strCityName, "false";
    end
    end


    Now, I need to pull up a pic called citypic.png that’s in the folder that the global function had already found. Here’s what I attempted to use:


    Image.Load("city_Image", "AutoPlay\\citys\\".. strCityName .."citypic.png");

    I’m sure I jacked this up!
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2133

    #2
    So does this:

    Image.Load("city_Image", "AutoPlay\\citys\\".. strCityName .."citypic.png");

    look correct? [sheepish grin]

    Comment

    • Corey
      Indigo Rose Staff Alumni
      • Aug 2002
      • 9741

      #3
      Well offhand if strCityName is a folder then maybe it should be

      Image.Load("city_Image", "AutoPlay\\citys\\".. strCityName .."\\citypic.png");

      Comment

      • Bruce
        Indigo Rose Customer
        • Jun 2001
        • 2133

        #4
        Yep that was it! (\\) Thanks for your help Corey. Thanks Tigg.

        Comment

        Working...
        X