mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
It's a pity the id can be only the a number.
A string would have some benefits:
- it could have a name indicating what it is for, which would make it much easier to remember, it's much harder to remember numbers than to remember names.
- it allows to have shorter id's because a range A-Z 0-9 (etc?) allows for much more combinations for the same length.

Of course, using complete descriptive names like 'funtools.list.addnew' would seriously limit the amount simultaneous affected ids for a /did command, but, that would be entirely up to the scripter. It gives the free choice.
If he decides its more important to have easier to remember names than the drawback of needing more /did commands, then he choses the first, or in the other case, the latter.

And ranges would be still possible, alike /did -c funtools.checks.* or /did -c funtools.checks.1-funtools.checks.4, so some reserved chars like * and - would be needed then.

Personally, I would like it especially for being able to have controls named like FT1 FT2 FT3, whereas the FT stands for 'funtools' (just an imaginary example) so any controls with names matching FT* would belong to that same script part.

It would make it hell a lot easier to create and maintain a script. Now the only thing you can use in a search in the script editor is a number, so it can have alot false positives, especially with the lower numeric ranges, and for ex id 10 is inside 110 so also a false positive, and that's becoming a real pain when dealing with larger dialogs.

I know you can use a hashtable etc to couple id numbers to names, but thats a big messy overhead and bloat since it requires to use an in between command/identifier referencing all over the place, alike having to do var %h = Hconfig | did -c funtools $hget(%h,FT1,FT2,FT3), the lesser the amount of affected controls, the bigger the overhead counts.


Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547

Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
Oh, I searched only 3 years ago, guess thats a 'no' then.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can use local aliases as well.

Code:
alias -l id_a { return 1 } 
alias -l id_b { return 2 } 
alias -l id_c { return 3 } 
alias -l id_d { return 4 } 

dialog test {
  title ""
  size -1 -1 300 300
  option dbu
  button "a", $id_a, 0 0 150 150
  button "b", $id_b, 151 0 150 150
  button "c", $id_c, 0 151 150 150
  button "d", $id_d, 151 151 150 150
}
on *:dialog:test:sclick:*:{ 
  if ($did == $id_a) { noop $input(a,dho,b) }
}

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Thats why i love DCXML
no need to id controls other then the ones your planning to script with smile


$maybe
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
Well, I read alot about DCX but since ever it just crashes mirc at the first access, I was told and I have read that the cause is my os (windows 98), I bought once XP but threw it off after some months of daily crap and annoyancy, and also hardware which didnt have a driver planned for it. So sadly, it's not an option here.

Besides that, having to use a numerous features-dll, which is also quite complex and needs alot learning, even for a first 'hello world' style thing, sounds as alot work for just a narrow goal, also requiring a complete dialog code rewrite, which is not quite an option for a script in a later stage.

I do not know how mIRC handles control id's internally, i.e., if the used OS functions also use them directly or after some mathematical conversion, but maybe a mapping table format "script name:os name" or so could then convert the script 'names' to the format it uses and vice versa.
It would be a major improvement due to the earlier mentioned benefits.






Link Copied to Clipboard