mIRC Home    About    Download    Register    News    Help

Print Thread
#33955 04/07/03 12:47 AM
Joined: Jan 2003
Posts: 108
H
Vogon poet
OP Offline
Vogon poet
H
Joined: Jan 2003
Posts: 108
ive been trying to use a binvar to output a socket from a txt file, being data.txt. Anyhow, usually start and end end up being:
%start 3668
%end 3955
To return the text in between it ive been using $bvar... Idk if theres a char limit or something, but it keeps on saying:
* String too long: $bvar (line 32, cscript.mrc)
Line 32 being %read
Code:
alias csearchparse {
  bread data.txt 0 $file(data.txt).size &var
  set %start $calc($bfind(&var, 1, <H4>1.) + 6)
  set %end $bfind(&var, 1, <H4>2.)
  set %read $bvar(&var, %start, %end)
}

Is there another way around $bvar, or am I just using it wrong. I just thought the reason for using binvar was to maximise the number of chars, which in this case it doesnt. Thanks ahead of time smile

#33956 04/07/03 10:39 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
First of all, it's not $bvar(&var,<start>,<end>) , it's $bvar(&var,<start>,<length>). Second, you didn't use the .text property with $bvar(), so %read would contain a series of ascii numbers (eg 45 56 89 92) instead of the actual text. Try this:

set %read $bvar(&var,%start,$calc(%end - %start)).text

Also remember that binvars do allow you to handle larger sizes, but the moment you convert them to text with $bvar(), the limits on string length kick in inevitably. So, binvars won't help you display or handle a larger string as text.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#33957 04/07/03 12:40 PM
Joined: Jan 2003
Posts: 108
H
Vogon poet
OP Offline
Vogon poet
H
Joined: Jan 2003
Posts: 108
Can I split it into two steps then? IE: Ascii - Text


Link Copied to Clipboard