rejetto forum

User Notes Whitespace

raybob · 6 · 4258

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Constant use of {.set account|n|notes key=a=b.} seems to fill up the user notes with huge amounts of whitespace.

Can someone else see if this happens to them also?


Offline Roessi

  • Tireless poster
  • ****
    • Posts: 107
    • View Profile
Yea i checked that and experienced the same problem, for every call a whitespace is added,

You can trim all the existing out by using

Code: [Select]
{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.get account|$1|notes.}.}.}.}.}.}

and to avoid it u have to set the entire notes again, but trimmed
ieither by adding a line after every call or adding an alias and using it instead , like :

Code: [Select]
[special:alias|private]
addnote={.set account|$1|notes key=$2=$3.}{.set account|$1|notes={.trim|{.get account|$1|notes.}.}.}


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Very nice!!  That works perfectly for removing whitespace.  I just put it in my sign in and sign out scripts so it's done once in a while for each account and will keep hfs.ini from expanding exponentially.  

I created my own ^notes function which is simpler to use and put your function in there so that my notes are always nice and tidy  ;)
« Last Edit: March 22, 2012, 02:09:14 AM by raybob »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
the bug is clearly in this line
replace(s, val, i, findEOL(s,i));

in file utillib.pas:2740
sadly i cannot compile HFS at the moment, i will just put this in the to-do list.


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Glad you figured it out.  Here's the function I'm using:

Code: [Select]
{.set|notes|{:{.if|$3|{:{.set account|$1|notes key=$2=$3.}{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.get account|$1|notes.}.}.}.}.}.}:}.}{.if|{.and|$2|{.not|$3.}|{.not|$4.}.}|{:{.get account|$1|notes key=$2.}:}.}{.if|{.and|$2|{.not|$3.}|$4.}|{:{.set account|$1|notes={.decodeuri|{.replace|%0A%0D||{.encodeuri|{.trim|{.replace|$2={.^notes|$1|$2.}||{.get account|$1|notes.}.}.}.}.}.}.}:}.}:}.}

{.^notes|username|key.}            expands to its value
{.^notes|username|key|value.}    writes a new value
{.^notes|username|key||true.}    erases the key
« Last Edit: April 06, 2012, 04:27:12 AM by raybob »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile