how can i save color code for next use ?
APZ file :
DOWNLOAD
Professional Software Development Tools
how can i save color code for next use ?
APZ file :
DOWNLOAD
Global Functions:
Slider_Btn_R On Click:Code:LastColor = 0;
Slider_Btn_G 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_B 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);
Page >> On Close: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);
Code:TextFile.WriteFromString("C:\\bgcolor.txt", LastColor , false);
thanks alot Reteset
but i cant load the same color next use
i put this on preload but it didnt work !!!
Code:result = TextFile.ReadToString("C:\\bgcolor.txt"); Shape.SetFillColor("Shape1", result);
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!!
try this GoOgLe
Code:result = TextFile.ReadToString("C:\\bgcolor.txt"); color = String.ToNumber(result); Shape.SetFillColor("Shape1", color);
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!!
what am i doing wrong ?
On Show:
On Close:Code:result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", LastColor); color = String.ToNumber(result); Shape.SetFillColor("Shape1", color);
Code:INIFile.SetValue(_WindowsFolder.."\\My Settings.ini", LastColor);
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!!