Improvement requests
: K-Meleon Web Browser Forum
Use this forum to talk about a feature you're missing.
Go to:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
[Please, enable JavaScript to see the code]
Enter code:
[quote=JamesD] I have asked for a new special variable. \null, for the macro language. http://kmeleon.sourceforge.net/forum/read.php?4,94189 I am posting the latest version of ini_Demo.kmm. I have changed the $_ini_Demo_Item variable name to $_ini_Demo_Key to make it consistent with the names for part of an ini file. This version of the macro does not require Windows Scripting Host for the the ini file delete operation. Thank to Jujuland and degas2 for help on that. Just saw Mark307's post. I will look into using that. [b]ini_Demo.kmm[/b] [code] # K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage) # # ---------- ini_Demo.kmm # ---------- Valid for KM 1.5.3 --------------- # # Dependencies : main.kmm # Resources : ini_Demo.ini # Preferences : - # Version : 0.6 6/26/09 JamesD # -------------------------------------------------------------------------------- _ini_Demo_RunCode{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Key = "Orange" ; $_ini_Demo_Value = "Common" ; alert($_ini_Demo_Path, "Proposed file name", INFO); alert(" section name ".$_ini_Demo_Section."\n item name ".$_ini_Demo_Key."\n item value ".$_ini_Demo_Value, "Proposed field values", INFO); iniwrite($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); alert(readfile($_ini_Demo_Path), "The file as written", INFO); } _ini_Demo_RunCode2{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Key = "Orange" ; $_Value = "" ; $_Value = iniread($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); alert($_Value, "item value", INFO); $_Value==""?0:alert(readfile($_ini_Demo_Path), "The file as written", INFO); } _ini_Demo_RunCode3{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Key = "Orange" ; #$_ini_Demo_Value = ""; ## No delete, the value becomes blank #$_ini_Demo_Value = -0; ## No delete, the value becomes 0 #$_ini_Demo_Value = \n; ## No delete, the value becomes blank #$_ini_Demo_Value = \t; ## No delete, the value becomes blank #$_ini_Demo_Value = ; ## No delete, the value becomes blank #$_ini_Demo_Value = '\0'; ## No delete, the value becomes blank #$_ini_Demo_Value = \0 ; ## No delete, the value becomes blank #$_ini_Demo_Value = null; ## No delete, the value becomes 'null' $_ini_Demo_Value = \null; ## No delete, the value becomes blank iniwrite($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); alert(readfile($_ini_Demo_Path), "The file as written", INFO); $_Value = "" ; $_Value = iniread($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); $_ini_Dtext1 = "As you can see, this does not delete \n" ; $_ini_Dtext2 = "the line as expected. The value for the \n " ; $_ini_Dtext3 = "key, Orange, has been set equal to " ; alert($_ini_Dtext1.$_ini_Dtext2.$_ini_Dtext3.$_Value.".", "Delete Key", INFO); } _ini_Demo_RunCode4{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Key = "" ; $_ini_Demo_Value = ""; iniwrite($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); alert(readfile($_ini_Demo_Path), "The file as written", INFO); $_ini_Dtext1 = "As you can see, this does not delete \n" ; $_ini_Dtext2 = "the section as expected. The value for the \n " ; $_ini_Dtext3 = "Key Orange is unchanged, and a new \n" ; $_ini_Dtext4 = "key line has been created. " ; alert($_ini_Dtext1.$_ini_Dtext2.$_ini_Dtext3.$_ini_Dtext4, "Delete Section", INFO); } _ini_Demo_RunCode5{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Key = "Orange" ; $_ini_Demo_Value = "Unique" ; alert("This will change the value of key, Orange, to \"Unique\""); iniwrite($_ini_Demo_Section, $_ini_Demo_Key, $_ini_Demo_Value, $_ini_Demo_Path); alert(readfile($_ini_Demo_Path), "The file as written", INFO); } _ini_Demo_RunCode6{ exec("cmd /c ERASE \"".$_ini_Demo_Path."\""); ## For user of win9x operating systems, cmd should be replaced with Command in the above line } _ini_Demo_BuildMenu{ # add another option to Help menu $_ini_Demo_Popm = "ini Demo Testing" ; setmenu("KMDocs",popup,$_ini_Demo_Popm,3); setmenu($_ini_Demo_Popm,"macro","Writing","_ini_Demo_RunCode"); setmenu($_ini_Demo_Popm,"macro","Reading","_ini_Demo_RunCode2"); setmenu($_ini_Demo_Popm,"macro","Delete item","_ini_Demo_RunCode3"); setmenu($_ini_Demo_Popm,"macro","Delete section","_ini_Demo_RunCode4"); setmenu($_ini_Demo_Popm,"macro","Overwrite item","_ini_Demo_RunCode5"); setmenu($_ini_Demo_Popm,"macro","Delete ini file","_ini_Demo_RunCode6"); } _ini_Demo_GetPath{ ## assumes that "ini_Demo.kmm" and "ini_Demo.js" are in UserMacroFolder $_ini_Demo_Path=getfolder(UserMacroFolder)."\\ini_Demo.ini"; $_ini_Demo_JSpath =getfolder(UserMacroFolder)."\\ini_Demo.js"; } # - - - - - - - - - - - - - - - $OnStartup=$OnStartup."_ini_Demo_GetPath;"; $OnInit=$OnInit."_ini_Demo_BuildMenu;"; $macroModules=$macroModules."ini_Demo;"; [/code][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
FAQ
English