flat assembler
Message board for the users of flat assembler.

Index > Main > [fasmg] How to perform case-insensitive checks in CALM?

Author
Thread Post new topic Reply to topic
Calanor



Joined: 19 Jul 2015
Posts: 45
Location: Sweden
Calanor 12 Jan 2021, 20:50
Perhaps I'm missing something obvious, but how would one go about to perform a case-insensitive comparison between two variables in CALM? E.g. I am overriding the include instruction in order to check for redundancies, but for obvious reasons I don't want to use a case-sensitive check when determining if a file's already been included.
Post 12 Jan 2021, 20:50
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 12 Jan 2021, 20:54
If you mean a comparison of two string values, then there is no such operation. You'd have to implement it manually, and also adapt for the encoding that you would expect to use - fasm[g] by itself is encoding-unaware, it just treats any characters outside of 7-bit ASCII range as raw.

Also, even case-insensitive check is not a truly reliable method to determine whether two paths point to the same file. This in general would require some kind of specialized interface with OS. As fasm[g]'s core is written in an OS-independent way, things like file caching used internally always treats paths that differ in any way as pointing to different files - not only some OS-es (like Linux/Unix) might have case-sensitive filesystems, it is even conceivable that fasm[g] may be ported to an OS that uses a completely different set of rules for path building.
Post 12 Jan 2021, 20:54
View user's profile Send private message Visit poster's website Reply with quote
Calanor



Joined: 19 Jul 2015
Posts: 45
Location: Sweden
Calanor 12 Jan 2021, 21:04
Hmm, I can see your point. OK, thanks for the info, Tomasz!
Post 12 Jan 2021, 21:04
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 12 Jan 2021, 21:18
I'm off on a tangent, but I like to point to this guide as a demonstration what a can of worms path processing can be on Windows systems.
Post 12 Jan 2021, 21:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.