473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

An exasperating bug for your amusement.


Here's a bug I found in a program of mine, after much
exasperation trying to find out why this wasn't working.
You all might find it educational and/or entertaining.

I had this line of code:

rhdir::LoadFileList(RawFiles, "qgv??-raw.txt");

Basically, it looks for files in the current directory
named "qgv??-raw.txt" (where the question marks are
being used in the context of wildcard characters),
and loads the names of all such files into a
std::list<std::stringobject named "RawFiles".
Seems very simple.

And yet, although I had a bunch of files named:

qgv17-raw.txt
qgv32-raw.txt
qgv88-raw.txt

none of them were getting into the list. What went
wrong?

You ain't gonna believe this....

The function LoadFileList() was actually looking for
a file named "qgv~raw.txt", and since there was no
such file, the "RawFiles" list remained empty.

Why?

The answer is: the character sequence ??- is NOT
three characters! It's ONE character, a tilde ~ .
It's one of those blasted "triglyph" thingies left
over from the days when certain characters weren't
actually on keyboards and had to be "faked".

So I backslashed the question marks:

rhdir::LoadFileList(RawFiles, "qgv\?\?-raw.txt");

and the program worked fine. Live and learn.

--
Cheers,
Robbie Hatley
lonewolfintj aatt pacbell dott net
triple-dubya dott tustinfreezone dott org
Apr 15 '07 #1
1 2649

"Robbie Hatley" <bo***********@no.spamwrote in message
news:rc***************@newssvr17.news.prodigy.net. ..
>
Here's a bug I found in a program of mine, after much
exasperation trying to find out why this wasn't working.
You all might find it educational and/or entertaining.

I had this line of code:

rhdir::LoadFileList(RawFiles, "qgv??-raw.txt");

Basically, it looks for files in the current directory
named "qgv??-raw.txt" (where the question marks are
being used in the context of wildcard characters),
and loads the names of all such files into a
std::list<std::stringobject named "RawFiles".
Seems very simple.

And yet, although I had a bunch of files named:

qgv17-raw.txt
qgv32-raw.txt
qgv88-raw.txt

none of them were getting into the list. What went
wrong?

You ain't gonna believe this....

The function LoadFileList() was actually looking for
a file named "qgv~raw.txt", and since there was no
such file, the "RawFiles" list remained empty.

Why?

The answer is: the character sequence ??- is NOT
three characters! It's ONE character, a tilde ~ .
It's one of those blasted "triglyph" thingies left
over from the days when certain characters weren't
actually on keyboards and had to be "faked".

So I backslashed the question marks:

rhdir::LoadFileList(RawFiles, "qgv\?\?-raw.txt");

and the program worked fine. Live and learn.
One of my compilers often complains that I've got "invalid triglyphs",
because in my comments when developing I often put ??? at the end of a
comment when I'm not sure of what I've written and want to come back and
revisit that point later. But I found that the compiler has an option to
turn off triglyph recognition entirely. Perhaps yours has that option?

-Howard

Apr 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Shawn Wilson | last post by:
Hi, Thought you might get a kick out of this. It happened a few days ago. A couple years ago I set up a small database to hold the Portfolio information (we're an ad agency) of the company I...
12
by: windandwaves | last post by:
Hi Folks I have just completed a project for an accommodation finder in New Zealand - much with your help - thank you again. I would appreciate any constructive or deconstructive comments. ...
1
by: RamTurbo | last post by:
RamTurbo 2.6 Increase your computer speed by up to 200% Stop your computer from windows crashes Recover 100% of memory leaks Boost your PC memory and performance Control running applications...
0
by: Gerald Bauer | last post by:
Hello, I invite you to cast your vote in the Year 2003 awards sponsered by the Java Republic, the Saturn Times and the Richmond Post news blogs. Here's the line-up: * What is Your Scripting...
0
by: Vanilla Sky | last post by:
In your butt Put the boogie in your butt Put, put the boogie in your butt In your butt Put the boogie in your butt Put, put the boogie in your butt I ain't puttin no boogie in nobody's butt...
1
by: WillWeGetOurFreedomBack | last post by:
When I try to run the query below, I get a warning that says Access could not insert ANY of the records due to Validation rule violations. Access gives me NO hint WHICH fields are violating the...
192
by: Vortex Soft | last post by:
http://www.junglecreatures.com/ Try it and tell me what's happenning in the Microsoft Corporation. Notes: VB, C# are CLS compliant
5
by: Mike Labosh | last post by:
I am teaching a class at a local client's office to bring some VBA and Fox programmers up to speed on VB.NET. Four days of training to cover Forms, Web Apps, Services, XML, Console Apps,...
0
by: Gary Paris | last post by:
It seems that you have a definite problem in life. The way to solve your problem is to follow these simple steps. First take a bootable floppy in reboot your computer. At the A: Prompt, type...
2
by: oorga.power | last post by:
Our 90 % percent work based on our mind. all the successful person of this world won from mind. C Langugae is great language, it needs logics. Logics can only give your logical part of brain,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.