mIRC Home    About    Download    Register    News    Help

Print Thread
#108319 18/01/05 10:49 PM
Joined: Sep 2003
Posts: 20
E
emull Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Sep 2003
Posts: 20
I need some help with binary variables. I need to compile a buffer consisting of the old buffer with excess data, &Overplus, and what is currently read from a socket, &Buffer. How do I put these together? I attempted /bcopy &Overplus $calc($bvar(&Overplus, 0) + 1) &Buffer 1 -1, however it fails if &Overplus doesn't exist.

The only solution I can see, is to initialize &Overplus, if it doesn't already exist, with one byte, and then overwrite it with /bcopy. However, this is an ugly hack, and I would much rather appreciate some other suggestions. Or should Khaled add a function for initializing binary variables, or modify /bcopy to do it automatically?

#108320 18/01/05 11:21 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The code you've given shouldn't fail if &Overplus doesn't exist, it will simply copy the contents of &Buffer to the first byte of &Overplus, which seems to be what you want. Are you sure it's not some other code that's causing trouble?


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard