Improvement requests
: K-Meleon Forum
Use this forum to talk about a feature you're missing. Use the bug tracker to report it if necessary.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=JamesD] @ desga2 I have tried everything I can think of for a null value. I have even tried leaving out the variable name and just having the commas for placeholders but nothing seems to work. I don't know if this is a bug or the work in incomplete. I want to start work on updating Macrolibary2, but I don't want to put incomplete data or incorrect data there. I am including my most up-to-date test files. Some things work just fine. [code] Write ini file - works Read ini file - works Overwrite ini info - works Delete item from file - not as expected Delete section from file - not as expected Delete the ini file - works ( using JScript ) [/code] [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, ini_Demo.js # Preferences : - # Version : 0.5 6/25/09 JamesD # -------------------------------------------------------------------------------- _ini_Demo_RunCode{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Item = "Orange" ; $_ini_Demo_Value = "Common" ; alert($_ini_Demo_Path, "Proposed file name", INFO); alert(" section name ".$_ini_Demo_Section."\n item name ".$_ini_Demo_Item."\n item value ".$_ini_Demo_Value, "Proposed field values", INFO); iniwrite($_ini_Demo_Section, $_ini_Demo_Item, $_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_Item = "Orange" ; $_Value = iniread($_ini_Demo_Section, $_ini_Demo_Item, $_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_Item = "Orange" ; $_ini_Demo_Value = ; iniwrite($_ini_Demo_Section, $_ini_Demo_Item, $_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 line as expected. The value for the \n " ; $_ini_Dtext3 = "item Orange has been set equal to blank." ; alert($_ini_Dtext1.$_ini_Dtext2.$_ini_Dtext3, "Delete item", INFO); } _ini_Demo_RunCode4{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Item = ; $_ini_Demo_Value = ; iniwrite($_ini_Demo_Section, $_ini_Demo_Item, $_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 = "item Orange is unchanged, and a blank \n" ; $_ini_Dtext4 = "equal blank line has been created. " ; alert($_ini_Dtext1.$_ini_Dtext2.$_ini_Dtext3.$_ini_Dtext4, "Delete item", INFO); } _ini_Demo_RunCode5{ $_ini_Demo_Section = "Dictionary" ; $_ini_Demo_Item = "Orange" ; $_ini_Demo_Value = "Unique" ; iniwrite($_ini_Demo_Section, $_ini_Demo_Item, $_ini_Demo_Value, $_ini_Demo_Path); alert(readfile($_ini_Demo_Path), "The file as written", INFO); } _ini_Demo_RunCode6{ exec("wscript.exe \"".$_ini_Demo_JSpath."\" \"".$_ini_Demo_Path."\""); } _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] [b]ini_Demo.js[/b] [code] /* ini_Demo.js by JamesD, version 0.1 2009-06-25 This script is a helper application for the K-Meleon Macro Module ini_Demo.kmm that enables you to delete an ini file. Windows Script Host 2.0 (or better) required! WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is available at http://msdn.microsoft.com/scripting/ */ var Current_iniFile_Path = WScript.Arguments(0); var obj = new ActiveXObject("Scripting.FileSystemObject"); if ( obj.fileExists(Current_iniFile_Path)) {obj.DeleteFile ( Current_iniFile_Path ); } [/code][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development