Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2007
    Posts
    452

    save statement for next use

    how can i save color code for next use ?

    APZ file :
    DOWNLOAD

  2. #2
    Join Date
    May 2006
    Posts
    1,443
    Global Functions:
    Code:
    LastColor = 0;
    Slider_Btn_R On Click:
    Code:
    local nR = e_Pos;						
    local nG = SliderEx.GetSliderPos("Slider_G");	
    local nB = SliderEx.GetSliderPos("Slider_B");	
    local nColor = Math.RGBToNumber(nR, nG, nB);	
    LastColor = nColor;
    Shape.SetFillColor("Shape1", nColor);
    Slider_Btn_G On Click:
    Code:
    local nR = SliderEx.GetSliderPos("Slider_R");
    local nG = e_Pos;
    local nB = SliderEx.GetSliderPos("Slider_B");
    local nColor = Math.RGBToNumber(nR, nG, nB);
    LastColor = nColor;
    Shape.SetFillColor("Shape1", nColor);
    Slider_Btn_B On Click:
    Code:
    local nR = SliderEx.GetSliderPos("Slider_R");
    local nG = SliderEx.GetSliderPos("Slider_G");	
    local nB = e_Pos;							
    local nColor = Math.RGBToNumber(nR, nG, nB);
    LastColor = nColor;
    Shape.SetFillColor("Shape1", nColor);
    Page >> On Close:
    Code:
    TextFile.WriteFromString("C:\\bgcolor.txt", LastColor , false);

  3. #3
    Join Date
    Mar 2007
    Posts
    452
    thanks alot Reteset

    but i cant load the same color next use

  4. #4
    Join Date
    Mar 2007
    Posts
    452
    i put this on preload but it didnt work !!!

    Code:
    result = TextFile.ReadToString("C:\\bgcolor.txt");
    Shape.SetFillColor("Shape1", result);

  5. #5
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by GoOgLe View Post
    i put this on preload but it didnt work !!!

    Code:
    result = TextFile.ReadToString("C:\\bgcolor.txt");
    Shape.SetFillColor("Shape1", result);
    but it didnt work !!!
    I'm getting really tired and annoyed at this.

    Anyway, you can't set it from a string. Use String.ToNumber then SetFillColor.

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    GOOGLE, open AMS, goto the main menu, click about>>help, look for the actions section, then look for INIFile.....all the information you need is there
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    Mar 2007
    Posts
    172
    try this GoOgLe

    Code:
    result = TextFile.ReadToString("C:\\bgcolor.txt");
    color = String.ToNumber(result);
    Shape.SetFillColor("Shape1", color);

  8. #8
    Join Date
    May 2006
    Posts
    5,380
    storeing 1 line of text in a file like that is a waist, what if you need to save more settings....more files..?..

    use a ini file to store app settings

    Code:
    result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "bgcolor");
    color = String.ToNumber(result);
    Shape.SetFillColor("Shape1", color);
    Open your eyes to Narcissism, Don't let her destroy your life!!

  9. #9
    Join Date
    Mar 2007
    Posts
    452
    what am i doing wrong ?

    On Show:
    Code:
    result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", LastColor);
    color = String.ToNumber(result);
    Shape.SetFillColor("Shape1", color);
    On Close:
    Code:
    INIFile.SetValue(_WindowsFolder.."\\My Settings.ini", LastColor);

  10. #10
    Join Date
    May 2006
    Posts
    5,380
    dont use a variable for the page show bit, it needs the actual name of the ini value, also you dont have enough arguments

    i take it you are storeing the color in the variable "LastColor"

    try this
    Code:
    -- on show
    result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "LastColor");
    color = String.ToNumber(result);
    Shape.SetFillColor("Shape1", color);
    
    -- on close
    INIFile.SetValue(_WindowsFolder.."\\My Settings.ini", "LastColor",LastColor);
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. help with save as
    By Dangerscott2020 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 07-05-2007, 12:38 AM
  2. IF Statement layout
    By Sooty in forum Setup Factory 6.0
    Replies: 0
    Last Post: 10-19-2004, 06:39 AM
  3. Displaying a Save As Dialog
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-01-2003, 03:53 PM
  4. WHILE loop inside a IF/ENDIF statement???? Bug??
    By TJ_Tigger in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 04-27-2003, 07:49 PM

Posting Permissions

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