Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 902 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_for_entfile upper case / capitals #463132
11/16/16 15:01
11/16/16 15:01
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hi,

Seeing that str_for_entfile gives the entirely filename string of the entity in upper case / capitals (so Item becomes ITEM), is there a way to fix that so that it shows it normally?

ty

Re: str_for_entfile upper case / capitals [Re: Reconnoiter] #464496
02/19/17 17:27
02/19/17 17:27
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
I just noticed a solution to this, I dont know if this is the best solution but it does work:

1) use txt_for_dir to get all the model name on startup (/only once)
2) do str_for_entfile when needed
3) compare returned string from str_for_entfile with the text you used in txt_for_dir (use str_cmpi for comparison in a for loop), when match use uppercase correct string from text pstring (e.g. (myText.pstring)[i] ) and break;.

Last edited by Reconnoiter; 02/19/17 17:30.
Re: str_for_entfile upper case / capitals [Re: Reconnoiter] #464497
02/19/17 19:43
02/19/17 19:43
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
If you want everything in lowercase this method is just wasting cpu.
Simply go through each character, check if its between 'A' and 'Z' and if yes add 32 or the delta of 'a' - 'A' (which is 32) to get lowercase.
If you want to keep the exact same case as in the names I doubt theres a good way for this

Re: str_for_entfile upper case / capitals [Re: Ch40zzC0d3r] #464498
02/19/17 21:28
02/19/17 21:28
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
No you misunderstood, I don't want everything lowercase. One can simply use str_lwr(STRING*) for that. I was just posting this solution (which is fine enough for me now) in case someone else had this problem.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1