mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
I like how /bwrite has the ability to write a character with any given ascii code.

/write can print them all except 0

/writeini can print them all except 0, 2, 3, 15, 22, 31

Any chance on fixing that?
If you've designed it this way on purpose, would you mind explaining? Thanks a lot.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Only /bwrite can write char 0, since it's a "binary" character. /write and /writeini are not binary safe. Khaled didn't design this- this was designed over 30 years ago in early UNIX systems. In fact, being able to write the 0 character is exactly why Khaled implemented /bwrite, /bread, and other binary safe functions

2,3,15,22 and 31 should be writeable by /writeini-- whether or not you can see them is another story, but there is no reason they can't be used. If you are on Vista you should be aware that some of those characters may no longer have a glyph (a visible representation of the character) associated with them anymore. Theoretically, none of them should, since they're all in the non-printable space of the ASCII map.



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
True. I wasn't even thinking about that. But as far /writeini, that should be able to write those other characters, right?

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I was able to get writeini to write all of the characters you mentioned but 0. I had problems $readini'ing them. They could easily be being stripped somewhere along the way.. Can you provide a test case which shows the characters not writing to an ini file?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
Code:
var %i = 1
while (%i < 256) {
  writeini -n test.ini test chr $+ %i " $+ $chr(%i) $+ "
  inc %i
}


test.ini
Code:
[test]
chr1=""
chr2=""
chr3=""
chr4=""
chr5=""
chr6=""
chr7=""
chr8=""
chr9="	"
chr10="~"
chr11=""
chr12=""
chr13="~"
chr14=""
chr15=""
chr16=""
chr17=""
chr18=""
chr19=""
chr20=""
chr21=""
chr22=""
chr23=""
chr24=""
chr25=""
chr26=""
chr27=""
chr28=""
chr29=""
chr30=""
chr31=""
chr32=" "
chr33="!"
chr34="""
chr35="#"
chr36="$"
chr37="%"
chr38="&"
chr39="'"
chr40="("
chr41=")"
chr42="*"
chr43="+"
chr44=","
chr45="-"
chr46="."
chr47="/"
chr48="0"
chr49="1"
chr50="2"
chr51="3"
chr52="4"
chr53="5"
chr54="6"
chr55="7"
chr56="8"
chr57="9"
chr58=":"
chr59=";"
chr60="<"
chr61="="
chr62=">"
chr63="?"
chr64="@"
chr65="A"
chr66="B"
chr67="C"
chr68="D"
chr69="E"
chr70="F"
chr71="G"
chr72="H"
chr73="I"
chr74="J"
chr75="K"
chr76="L"
chr77="M"
chr78="N"
chr79="O"
chr80="P"
chr81="Q"
chr82="R"
chr83="S"
chr84="T"
chr85="U"
chr86="V"
chr87="W"
chr88="X"
chr89="Y"
chr90="Z"
chr91="["
chr92="\"
chr93="]"
chr94="^"
chr95="_"
chr96="`"
chr97="a"
chr98="b"
chr99="c"
chr100="d"
chr101="e"
chr102="f"
chr103="g"
chr104="h"
chr105="i"
chr106="j"
chr107="k"
chr108="l"
chr109="m"
chr110="n"
chr111="o"
chr112="p"
chr113="q"
chr114="r"
chr115="s"
chr116="t"
chr117="u"
chr118="v"
chr119="w"
chr120="x"
chr121="y"
chr122="z"
chr123="{"
chr124="|"
chr125="}"
chr126="~"
chr127=""
chr128="€"
chr129=""
chr130="‚"
chr131="ƒ"
chr132="„"
chr133="…"
chr134="†"
chr135="‡"
chr136="ˆ"
chr137="‰"
chr138="Š"
chr139="‹"
chr140="Œ"
chr141=""
chr142="Ž"
chr143=""
chr144=""
chr145="‘"
chr146="’"
chr147="“"
chr148="”"
chr149="•"
chr150="–"
chr151="—"
chr152="˜"
chr153="™"
chr154="š"
chr155="›"
chr156="œ"
chr157=""
chr158="ž"
chr159="Ÿ"
chr160=" "
chr161="¡"
chr162="¢"
chr163="£"
chr164="¤"
chr165="¥"
chr166="¦"
chr167="§"
chr168="¨"
chr169="©"
chr170="ª"
chr171="«"
chr172="¬"
chr173="­"
chr174="®"
chr175="¯"
chr176="°"
chr177="±"
chr178="²"
chr179="³"
chr180="´"
chr181="µ"
chr182="¶"
chr183="·"
chr184="¸"
chr185="¹"
chr186="º"
chr187="»"
chr188="¼"
chr189="½"
chr190="¾"
chr191="¿"
chr192="À"
chr193="Á"
chr194="Â"
chr195="Ã"
chr196="Ä"
chr197="Å"
chr198="Æ"
chr199="Ç"
chr200="È"
chr201="É"
chr202="Ê"
chr203="Ë"
chr204="Ì"
chr205="Í"
chr206="Î"
chr207="Ï"
chr208="Ð"
chr209="Ñ"
chr210="Ò"
chr211="Ó"
chr212="Ô"
chr213="Õ"
chr214="Ö"
chr215="×"
chr216="Ø"
chr217="Ù"
chr218="Ú"
chr219="Û"
chr220="Ü"
chr221="Ý"
chr222="Þ"
chr223="ß"
chr224="à"
chr225="á"
chr226="â"
chr227="ã"
chr228="ä"
chr229="å"
chr230="æ"
chr231="ç"
chr232="è"
chr233="é"
chr234="ê"
chr235="ë"
chr236="ì"
chr237="í"
chr238="î"
chr239="ï"
chr240="ð"
chr241="ñ"
chr242="ò"
chr243="ó"
chr244="ô"
chr245="õ"
chr246="ö"
chr247="÷"
chr248="ø"
chr249="ù"
chr250="ú"
chr251="û"
chr252="ü"
chr253="ý"
chr254="þ"
chr255="ÿ"

Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
bump

Joined: Mar 2006
Posts: 395
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
I just tested /writini and was able to use all characters up to 255, except 0 (which is a limitation of mIRC).

To do this, I just made a while loop set and retrieve the text.

When reading the text, be sure to use $asc($readini(inifile,section,data))

The reason to use $asc is that mIRC will (in most cases) not show some character due to most fonts not displaying them.

Edit: Try this:
Code:
var %i = 1
while (%i < 256) {
  echo -a RESULT FOR %i: $asc($noqt($readini(test.ini,test,chr $+ %i))
  inc %i
}

Last edited by The_JD; 14/02/08 07:07 PM.

[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
I had to alter that a little bit... The %i: needs the : to be separated from the %i, and there needs to be one extra ) symbol...

Code:
var %i = 1
while (%i < 256) {
  echo -a RESULT FOR %i $+ : $asc($noqt($readini(test.ini,test,chr $+ %i)))
  inc %i
}


Output:
Code:
RESULT FOR 1: 1
RESULT FOR 2:
RESULT FOR 3:
RESULT FOR 4: 4
RESULT FOR 5: 5
RESULT FOR 6: 6
RESULT FOR 7: 7
RESULT FOR 8: 8
RESULT FOR 9: 9
RESULT FOR 10: 126
RESULT FOR 11: 11
RESULT FOR 12: 12
RESULT FOR 13: 126
RESULT FOR 14: 14
RESULT FOR 15:
RESULT FOR 16: 16
RESULT FOR 17: 17
RESULT FOR 18: 18
RESULT FOR 19: 19
RESULT FOR 20: 20
RESULT FOR 21: 21
RESULT FOR 22:
RESULT FOR 23: 23
RESULT FOR 24: 24
RESULT FOR 25: 25
RESULT FOR 26: 26
RESULT FOR 27: 27
RESULT FOR 28: 28
RESULT FOR 29: 29
RESULT FOR 30: 30
RESULT FOR 31:
RESULT FOR 32:
RESULT FOR 33: 33
RESULT FOR 34:
RESULT FOR 35: 35
RESULT FOR 36: 36
RESULT FOR 37: 37
RESULT FOR 38: 38
RESULT FOR 39: 39
RESULT FOR 40: 40
RESULT FOR 41: 41
RESULT FOR 42: 42
RESULT FOR 43: 43
RESULT FOR 44: 44
RESULT FOR 45: 45
RESULT FOR 46: 46
RESULT FOR 47: 47
RESULT FOR 48: 48
RESULT FOR 49: 49
RESULT FOR 50: 50
RESULT FOR 51: 51
RESULT FOR 52: 52
RESULT FOR 53: 53
RESULT FOR 54: 54
RESULT FOR 55: 55
RESULT FOR 56: 56
RESULT FOR 57: 57
RESULT FOR 58: 58
RESULT FOR 59: 59
RESULT FOR 60: 60
RESULT FOR 61: 61
RESULT FOR 62: 62
RESULT FOR 63: 63
RESULT FOR 64: 64
RESULT FOR 65: 65
RESULT FOR 66: 66
RESULT FOR 67: 67
RESULT FOR 68: 68
RESULT FOR 69: 69
RESULT FOR 70: 70
RESULT FOR 71: 71
RESULT FOR 72: 72
RESULT FOR 73: 73
RESULT FOR 74: 74
RESULT FOR 75: 75
RESULT FOR 76: 76
RESULT FOR 77: 77
RESULT FOR 78: 78
RESULT FOR 79: 79
RESULT FOR 80: 80
RESULT FOR 81: 81
RESULT FOR 82: 82
RESULT FOR 83: 83
RESULT FOR 84: 84
RESULT FOR 85: 85
RESULT FOR 86: 86
RESULT FOR 87: 87
RESULT FOR 88: 88
RESULT FOR 89: 89
RESULT FOR 90: 90
RESULT FOR 91: 91
RESULT FOR 92: 92
RESULT FOR 93: 93
RESULT FOR 94: 94
RESULT FOR 95: 95
RESULT FOR 96: 96
RESULT FOR 97: 97
RESULT FOR 98: 98
RESULT FOR 99: 99
RESULT FOR 100: 100
RESULT FOR 101: 101
RESULT FOR 102: 102
RESULT FOR 103: 103
RESULT FOR 104: 104
RESULT FOR 105: 105
RESULT FOR 106: 106
RESULT FOR 107: 107
RESULT FOR 108: 108
RESULT FOR 109: 109
RESULT FOR 110: 110
RESULT FOR 111: 111
RESULT FOR 112: 112
RESULT FOR 113: 113
RESULT FOR 114: 114
RESULT FOR 115: 115
RESULT FOR 116: 116
RESULT FOR 117: 117
RESULT FOR 118: 118
RESULT FOR 119: 119
RESULT FOR 120: 120
RESULT FOR 121: 121
RESULT FOR 122: 122
RESULT FOR 123: 123
RESULT FOR 124: 124
RESULT FOR 125:
RESULT FOR 126: 126
RESULT FOR 127: 127
RESULT FOR 128: 128
RESULT FOR 129: 129
RESULT FOR 130: 130
RESULT FOR 131: 131
RESULT FOR 132: 132
RESULT FOR 133: 133
RESULT FOR 134: 134
RESULT FOR 135: 135
RESULT FOR 136: 136
RESULT FOR 137: 137
RESULT FOR 138: 138
RESULT FOR 139: 139
RESULT FOR 140: 140
RESULT FOR 141: 141
RESULT FOR 142: 142
RESULT FOR 143: 143
RESULT FOR 144: 144
RESULT FOR 145: 145
RESULT FOR 146: 146
RESULT FOR 147: 147
RESULT FOR 148: 148
RESULT FOR 149: 149
RESULT FOR 150: 150
RESULT FOR 151: 151
RESULT FOR 152: 152
RESULT FOR 153: 153
RESULT FOR 154: 154
RESULT FOR 155: 155
RESULT FOR 156: 156
RESULT FOR 157: 157
RESULT FOR 158: 158
RESULT FOR 159: 159
RESULT FOR 160: 160
RESULT FOR 161: 161
RESULT FOR 162: 162
RESULT FOR 163: 163
RESULT FOR 164: 164
RESULT FOR 165: 165
RESULT FOR 166: 166
RESULT FOR 167: 167
RESULT FOR 168: 168
RESULT FOR 169: 169
RESULT FOR 170: 170
RESULT FOR 171: 171
RESULT FOR 172: 172
RESULT FOR 173: 173
RESULT FOR 174: 174
RESULT FOR 175: 175
RESULT FOR 176: 176
RESULT FOR 177: 177
RESULT FOR 178: 178
RESULT FOR 179: 179
RESULT FOR 180: 180
RESULT FOR 181: 181
RESULT FOR 182: 182
RESULT FOR 183: 183
RESULT FOR 184: 184
RESULT FOR 185: 185
RESULT FOR 186: 186
RESULT FOR 187: 187
RESULT FOR 188: 188
RESULT FOR 189: 189
RESULT FOR 190: 190
RESULT FOR 191: 191
RESULT FOR 192: 192
RESULT FOR 193: 193
RESULT FOR 194: 194
RESULT FOR 195: 195
RESULT FOR 196: 196
RESULT FOR 197: 197
RESULT FOR 198: 198
RESULT FOR 199: 199
RESULT FOR 200: 200
RESULT FOR 201: 201
RESULT FOR 202: 202
RESULT FOR 203: 203
RESULT FOR 204: 204
RESULT FOR 205: 205
RESULT FOR 206: 206
RESULT FOR 207: 207
RESULT FOR 208: 208
RESULT FOR 209: 209
RESULT FOR 210: 210
RESULT FOR 211: 211
RESULT FOR 212: 212
RESULT FOR 213: 213
RESULT FOR 214: 214
RESULT FOR 215: 215
RESULT FOR 216: 216
RESULT FOR 217: 217
RESULT FOR 218: 218
RESULT FOR 219: 219
RESULT FOR 220: 220
RESULT FOR 221: 221
RESULT FOR 222: 222
RESULT FOR 223: 223
RESULT FOR 224: 224
RESULT FOR 225: 225
RESULT FOR 226: 226
RESULT FOR 227: 227
RESULT FOR 228: 228
RESULT FOR 229: 229
RESULT FOR 230: 230
RESULT FOR 231: 231
RESULT FOR 232: 232
RESULT FOR 233: 233
RESULT FOR 234: 234
RESULT FOR 235: 235
RESULT FOR 236: 236
RESULT FOR 237: 237
RESULT FOR 238: 238
RESULT FOR 239: 239
RESULT FOR 240: 240
RESULT FOR 241: 241
RESULT FOR 242: 242
RESULT FOR 243: 243
RESULT FOR 244: 244
RESULT FOR 245: 245
RESULT FOR 246: 246
RESULT FOR 247: 247
RESULT FOR 248: 248
RESULT FOR 249: 249
RESULT FOR 250: 250
RESULT FOR 251: 251
RESULT FOR 252: 252
RESULT FOR 253: 253
RESULT FOR 254: 254
RESULT FOR 255: 255
* Error allocating evaluation memory (line 16, notice.ini)


Some of these results are rather peculiar...

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Most peculiar is:

* Error allocating evaluation memory (line 16, notice.ini)

edit:

First off, you need to add the "n" switch to $readini so it doesnt attempt to evaluate the results-- this will remove the above errors and change the results

Code:
alias testwriteini {
  var %i = 1
  while (%i < 256) {
    writeini test.ini test chr $+ %i $chr(%i) 
    inc %i
  }
  var %i = 1
  while (%i < 256) {
    echo -a RESULT FOR %i $+ : $asc($readini(test.ini,n,test,chr $+ %i))
    inc %i
  }
}


edit2:

So it turns out all the characters it won't write are control codes. this might be an old feature of mIRC to ignore control codes for some reason-- probably existing before $strip did. I doubt it's a bug, because it seems intentional, though Khaled should probably remove this.

this doesn't account for $chr(34), but that is the " character, which writes properly but won't read back in the test-- it's in the file though.

Last edited by argv0; 15/02/08 07:08 PM.

- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
I agree with your findings about character 34.
I also agree with your conclusion that the observed behavior for characters 2,3,15,22,31 was probably done intentionally in previous versions, but for the next version, mIRC needs to be able to read and write these characters with $readini and /writeini

One other peculiar thing that I just noticed. When /writeini attempts to write characters 10 and 13, a ~ is outputted instead. Therefore, when $readini attempts to read this characters, it reads character #126

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As a note, you can /write control characters, but cannot /writeini the control characters. You can, however, $readini the control characters correctly if they are in the file from either a /write or manually adding them to the file.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2006
Posts: 395
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
weird, seems I can do it fine :S Sorry about the bad loop, I was writing it straight to the board lol


[02:16] * Titanic has quit IRC (Excess Flood)

Link Copied to Clipboard