What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Translation » MsgPlus Hotkey Checker - 1.1.3

1 votes - 5 average   MsgPlus Hotkey Checker - 1.1.3
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: MsgPlus Hotkey Checker - 1.1.3
quote:
Originally posted by Shunter
2, If character is "]", clear collision array
3, If character is linebreak:
   3a, Check next character
   3b, If next character is linebreak, clear collision array
I didn't test this, but this explaination seems a bit dodgy if it realy happens like I read it...
A) you're only test for a new topic is "]" somewhere in a line?
B) linebreaks? you shouldn't let the code depend on linebreaks at all...



EDIT: I tested it with this file, and my assumptions are correct...
code:
[topic1]
key11=h&ello world
key12=[test]
key13=mor&e text

[topic2]
key21=yep th&is is topic number 2

key22=and mambo number f&ive

This is a valid INI file... As you can see your program doesn't reconize double apersands in both topics...

First, A new topic is ALWAYS started at a new line not in the middle of a line. For example, the value from key12 ([test]) isn't a new topic, it is a valid value for a key....
Also, remember that spaces in front of keys and spaces in front and behind a topic should be ignored. The following file is exact the same INI-file, and should be handled just the same (note I replaced the spaces with points so you can see them clearly):
code:
......................
............[topic1].................
.......key11=h&ello world
key12=[test]
............key13=mor&e text..........
.......
...[topic2]

...........................key21=yep th&is is topic number 2
...............................
........key22=and mambo number f&ive
(also note that the value of key13 is "mor&e text.........." in this case and not "mor&e text")

Second, linebreaks in a INI-file can occur everywhere, key21 and key22 are still part of topic2...  checking on linebreaks to check topics is a big no-no...

So,

How to detect a new topic (without the use of API's):
in pseudocode: TRIM(readline) == "[?*]"
- readline is the variable which holds the new textline read from the ini-file.
- TRIM is to strip the line from leading and trailing spaces
- [?*] means: starting with "[", then some text (at least 1 character), ending with "]"
This is the ONLY valid way. If the above function returns true, then, and only then, you have a new topic...

PS: Lines you should ignore (AFTER removing leading and trailing spaces!): empty lines and lines starting with ";"

;)


This post was edited on 05-19-2004 at 05:38 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-19-2004 05:13 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-15-2004 at 05:46 PM
RE: MsgPlus Hotkey Checker - 1.0.1 - by ZrednaZ on 05-15-2004 at 06:24 PM
RE: MsgPlus Hotkey Checker - 1.0.1 - by Leif on 05-15-2004 at 06:54 PM
RE: MsgPlus Hotkey Checker - 1.0.1 - by ShunterAlhena on 05-15-2004 at 06:58 PM
RE: MsgPlus Hotkey Checker - 1.0.1 - by Patchou on 05-15-2004 at 07:04 PM
RE: MsgPlus Hotkey Checker - 1.0.1 - by Leif on 05-15-2004 at 07:29 PM
RE: MsgPlus Hotkey Checker - 1.1.2 - by ShunterAlhena on 05-15-2004 at 07:49 PM
RE: MsgPlus Hotkey Checker - 1.1.2 - by Leif on 05-15-2004 at 09:01 PM
RE: MsgPlus Hotkey Checker - 1.1.2 - by ShunterAlhena on 05-16-2004 at 06:53 AM
RE: MsgPlus Hotkey Checker - 1.1.2 - by Leif on 05-16-2004 at 11:10 AM
RE: MsgPlus Hotkey Checker - 1.1.2 - by CookieRevised on 05-16-2004 at 11:18 AM
RE: MsgPlus Hotkey Checker - 1.1.2 - by Leif on 05-16-2004 at 11:48 AM
RE: MsgPlus Hotkey Checker - 1.1.2 - by ShunterAlhena on 05-16-2004 at 12:10 PM
RE: MsgPlus Hotkey Checker - 1.1.2 - by CookieRevised on 05-16-2004 at 12:10 PM
RE: MsgPlus Hotkey Checker - 1.1.2 - by ShunterAlhena on 05-16-2004 at 07:02 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by Choli on 05-16-2004 at 08:07 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by Patchou on 05-16-2004 at 08:41 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-17-2004 at 12:30 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by Choli on 05-17-2004 at 01:25 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-17-2004 at 04:18 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by Kian on 05-18-2004 at 08:32 AM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-18-2004 at 02:46 PM
RE: RE: MsgPlus Hotkey Checker - 1.1.3 - by Kian on 05-18-2004 at 03:42 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by CookieRevised on 05-19-2004 at 05:21 AM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-19-2004 at 02:19 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by CookieRevised on 05-19-2004 at 05:13 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-19-2004 at 06:49 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by CookieRevised on 05-19-2004 at 11:20 PM
RE: MsgPlus Hotkey Checker - 1.1.3 - by Choli on 05-20-2004 at 10:44 AM
RE: MsgPlus Hotkey Checker - 1.1.3 - by ShunterAlhena on 05-20-2004 at 06:38 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On