bstriphtml (for &bvars)

By Spoofing on Nov 19, 2010

Just simple strip HTML for binary variables :P

//bset -t &content 1

hello world

| echo -a $bstriphtml(&content)
alias bstriphtml {
  bset $1 $calc($bvar($1,0) + 1) 0
  while ($bfind($1,0,<)) {
    var %< = $v1
    bcopy -c $1 %< $1 $calc(%< + 1) -1
    if ($bfind($1,%<,>)) {
      var %> = $v1
      bcopy -c $1 %< $1 $calc(%> + 1) -1
    }
  }
  return $bvar($1,1,$iif($version <= 6.32,512,4096)).text
}

Comments

Sign in to comment.
Jethro   -  Nov 19, 2010

Nice experiment using binvar to strip html tags.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.